Command::subcommand_required
subcommand_required
Section titled “subcommand_required ”If no subcommand is present at runtime, error and exit gracefully.
Example
Section titled “Example”name = "myprog"subcommand-required = true[[subcommands]]name = "test"
name: myprogsubcommand-required: truesubcommands:- name: test
{ "name": "myprog", "subcommand-required": true, "subcommands": [ { "name": "test" } ]}
myprog
Output
Section titled “Output”error: 'myprog' requires a subcommand but one was not provided [subcommands: test, help]
Usage: myprog <COMMAND>
For more information, try '--help'.