Open viscrisn opened 4 years ago
You can hack this in by inheriting from DefaultGroup
and then overwrite the parse_arg()
function like so:
def parse_args(self, ctx, args):
if (not args or args in (["-h"], ["--help"])) and self.default_if_no_args:
args.insert(0, self.default_cmd_name)
return super(DefaultGroup, self).parse_args(ctx, args)
However, this will make it impossible to get the original help messaging containing all the subcommands. So your users will be unaware of the other commands available.
The ideal solution would be to somehow merge the help messages from both the default command and main group. But I'm not sure how to do that...
Is there a way I can redirect one of the subcommand --help output to the group command's --help? For example:
cli --help
should outputfoo --help
description.Is this possible to customize --help in this way?