Skip to content

only first flag works #13

@adrian-gierakowski

Description

@adrian-gierakowski

replace example.nix with:

{ pkgs ? import <nixpkgs> {} }:
let climod = pkgs.callPackage ./default.nix { inherit pkgs; };
in climod {
  name = "multiple-flags";
  description = "Test multiple flags";
  action.bash = ''
    echo "A: ''${A:-}"
    echo "B: ''${B:-}"
  '';
  flags = [
    {
      description = "Flag a";
      keywords    = ["-a"];
      variable    = "A";
    }
    {
      description = "Flag b";
      keywords    = ["-b"];
      variable    = "B";
    }
  ];
}

and then run with:

$(nix-build example.nix)/bin/* -a aaa -b bbb

expected output:

A: aaa
B: bbb

actual output:

A: aaa
B:

removing the following lines seems to help:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions