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
sub-command not executed if using --version option #797
Comments
The |
Hello John, thanks for the reply. I was trying to find a way to make a difference depending on the option position in the command line, e.g. > spm --version module and > spm module --version Do you confirme this is not a feature handled by commander ? Is there a reason for this or would you be interested by a PR ? Thanks and have a good day ! |
Disclaimer: I am a user not a maintainer. (So comments are IMHO.) I do not think this feature is handled by commander. I think positional would match what people expect in at least some situations, but treating options globally may be by design. It is particularly surprising for --version which makes little sense when used with other arguments and options! But it feels quite natural with --help:
For an external reference, the first program I noticed non-positional global options with was Mercurial:
|
(I am a maintainer now!) This issue has not had any activity in over six months. It isn't likely to get acted on due to this report. Feel free to open a new issue if it comes up again, with new information and renewed interest. Thank you for your contributions. |
Pull Request opened to add |
Hello,
command :
> spm module publish --version 1.0.0
expected result:
action requested should be executed passing the value 1.0.0 to option.version for sub-command module
actual result:
program displays current CLI version and exits
Here are the files in question :
I have found many open/closed issues about options in sub-commands, and others for the version option, but I cannot manage to fix this behaviour. Is it a WAI or is there a way to achieve what I'm trying to do ? Thanks a lot in advance !
The text was updated successfully, but these errors were encountered: