currently, the help of the subcommands doesn't show the global flags/arguments of the parent.
Taking the following example:
equire "admiral"
class ParentCmd < Admiral::Command
class ChildCmd < Admiral::Command
define_help description: "Execute a subcommand."
define_argument childarg : String, description: "Arg for child", required: true
def run
puts "in ChildCmd with #{arguments.childarg}"
end
end
register_sub_command child : ChildCmd, "Child Command"
define_flag parentflag : Bool, description: "Parent flag", default: false, short: p
define_help description: "Test subcommands help with global flag"
def run
puts help
end
end
ParentCmd.run
I would expect the parentflag to show up in the ChildCmd help page:
$ ./testsub --help
Usage:
./testsub [flags...] [arg...]
Test subcommands help with global flag
Flags:
--help # Displays help for the current command.
--parentflag, -p # Parent flag
Subcommands:
child # Execute a subcommand.
$ /testsub child --help
Usage:
./testsub child [flags...] <childarg> [arg...]
Execute a subcommand.
Flags:
--help # Displays help for the current command.
Arguments:
childarg (required) # Arg for child
Hi,
currently, the help of the subcommands doesn't show the global flags/arguments of the parent. Taking the following example:
I would expect the
parentflag
to show up in theChildCmd
help page: