-
Is it possible to have a subcommand and an option do the same thing? Consider git, all the following commands get you the version:
I can of course add a |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Nevermind, I found |
Beta Was this translation helpful? Give feedback.
-
Usually what has been done in the past in cases where this is required is to add an option or flag with |
Beta Was this translation helpful? Give feedback.
Usually what has been done in the past in cases where this is required is to add an option or flag with
-v
and--version
and then a separate subcommand that has a callback that does the same thing as the option. If it is complicated then the callback versions of the option/flag can be used and the same callback used in the subcommand callback. This is a little "cleaner" than making a subcommand alias of "--version"