Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

only first flag works #13

Open
adrian-gierakowski opened this issue May 30, 2023 · 0 comments
Open

only first flag works #13

adrian-gierakowski opened this issue May 30, 2023 · 0 comments

Comments

@adrian-gierakowski
Copy link

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:

@adrian-gierakowski adrian-gierakowski changed the title only single flag works only first flag works May 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant