Is it possible to parse args and options of commands when running subcommands? #888
Unanswered
ottobolyos
asked this question in
Q&A
Replies: 1 comment 3 replies
-
I believe you're looking for something like this issue. Generally, I don't recall if Commander allows for sub commands to inherit the options from the parent commands. |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I want to have som options that are accepted by a command and I should be able to use them in subcommands.
For example:
plc
:-i, --ip <string>
;get
.Now, when I run
app plc get -i 1.1.1.1
, theoptions
array inGetCommand#run
is not in there. Moreover, if I add-i, --ip <string>
option toget
subcommand, Nest Commander associates the option withplc
command only, regardless of the command-option-subcommand order (i.e. it does not matter if it is${command} ${option} ${subcommand}
or${command} ${subcommand} ${option}
).Use case: when some options are used by all subcommands and we want to make it KISS-compliant.
Beta Was this translation helpful? Give feedback.
All reactions