clap-st icon indicating copy to clipboard operation
clap-st copied to clipboard

context>>#hasFlag: does not work when flag is not specified on the last subcommand

Open demarey opened this issue 2 years ago • 3 comments

When you have a command with one or many level of subcommands, there should be a way to ask the context if some flag is present or not.

exemple:

launcher image create fromPR 9588 --no-launch

In the example, the --no-launch flag is specified on the create subcommand spec. When asking #hasFlag: #'no-launch' to the context, it will search on the last subcommand: fromPR and by so will not find it. It should search from the command where it has been specified

demarey avatar Jan 18 '24 17:01 demarey

@demarey I think this is because you need to specify flag name with pound sign: e.g. self hasFlag: #no-launch (see senders).

Bajger avatar Jan 19 '24 07:01 Bajger

It is true that self hasFlag: #no-launch has to be used but it was only an error in the description. The problem described is there: there is an issue with parameters lookup.

demarey avatar Jan 19 '24 08:01 demarey

Ok,got it!

Bajger avatar Jan 19 '24 08:01 Bajger