Is it possible to have subcommands within subcommands?
I'd like the ability to do something like remote channel change 5, or remote channel read, where channel is the main subcommand and change and read are subcommands that are part of the channel subcommand.
I've attempted to do it with a yuck file like this:
Usage: remote
Interact with a television.
Usage: remote power on
Power on the television
Usage: remote power off
Power off the television
Usage: remote channel change [CHANNEL]...
Change channel to CHANNEL
Usage: remote channel read
Read current channel
Which generates the following:
$ ./remote --help
Usage: remote [OPTION]... COMMAND
Interact with a television.
COMMAND may be one of:
power Power off the television
channel Read current channel
Options accepted by all commands:
-h, --help display this help and exit
-V, --version output version information and exit
$ ./remote power --help
Usage: remote power off
Power off the television
Common options:
-h, --help display this help and exit
-V, --version output version information and exit
$ ./remote channel --help
Usage: remote channel read
Read current channel
Common options:
-h, --help display this help and exit
-V, --version output version information and exit
As you can see, it seems to only register the last sub-subcommand (e.g., power off and channel read) in the yuck file.
Is this functionality already present and I'm doing it incorrectly? If it isn't present, would the current architecture allow for it to be easily added? I would be happy to contribute.
Is it possible to have subcommands within subcommands?
I'd like the ability to do something like
remote channel change 5, orremote channel read, wherechannelis the main subcommand andchangeandreadare subcommands that are part of thechannelsubcommand.I've attempted to do it with a yuck file like this:
Which generates the following:
As you can see, it seems to only register the last sub-subcommand (e.g.,
power offandchannel read) in the yuck file.Is this functionality already present and I'm doing it incorrectly? If it isn't present, would the current architecture allow for it to be easily added? I would be happy to contribute.