Skip to content

Option names passed to statix are missing dashes #505

@adomixaszvers

Description

@adomixaszvers

Changes made in #503 introduced a call to lib.cli.toGNUCommandLineShell but it does not call mkOption on names so they are without dashes. I have reproduced the issue with expression

{
  pkgs ? import <nixpkgs> { },
}:
let
  inherit (pkgs) lib;
  settings = {
    format = [ "errfmt" ];
    ignore = [ "hardware-config.nix" ];
  };
in
{
  goodOptions = lib.cli.toGNUCommandLineShell { } settings;
  badOptions = lib.cli.toGNUCommandLineShell {
    mkList = name: value: [ name ] ++ lib.unique value;
  } settings;
}

.
Here goodOptions evaluates to '--format' 'errfmt' '--ignore' 'hardware-config.nix' and badOptions to 'format' 'errfmt' 'ignore' 'hardware-config.nix'.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions