Skip to content

Command::flatten_help

since 0.1.0

Flatten subcommand help into the current command’s help.

name = "myprog"
flatten-help = true
[args]
arg1 = {}
[[subcommands]]
name = "subcommand"
about = "a sub command"
flatten-help = true
[subcommands.args]
arg2 = {}
[[subcommands.subcommands]]
name = "nested"
about = "A nested sub command"
[subcommands.subcommands.args]
arg3 = { long = "arg3" }
[[subcommands]]
name = "subcommand2"
about = "another sub command"
[subcommands.args]
arg4 = {}
Terminal window
myprog --help
Terminal window
Usage: myprog [arg1]
myprog subcommand [arg2]
myprog subcommand nested [OPTIONS]
myprog subcommand help [COMMAND]
myprog subcommand2 [arg4]
myprog help [COMMAND]...
Arguments:
[arg1]
Options:
-h, --help Print help
myprog subcommand:
a sub command
-h, --help Print help
[arg2]
myprog subcommand nested:
A nested sub command
--arg3 <arg3>
-h, --help Print help
myprog subcommand help:
Print this message or the help of the given subcommand(s)
myprog subcommand2:
another sub command
-h, --help Print help
[arg4]
myprog help:
Print this message or the help of the given subcommand(s)
[COMMAND]... Print help for the subcommand(s)