I'm using python click for my CLI. When I pass in the wrong set of arguments or flags, a usage message pops up. However, when I use the --help flag a more detailed usage message pops up with a list of all options and arguments. Is there a way to change the default behavior so that a usage error prints the full detailed help?
For example, a missing argument prints
mycli foo
Usage: mycli foo [OPTIONS] MY_ARG
Error: Missing argument "my_arg".
But adding --help prints
mycli foo --help
Usage: mycli foo [OPTIONS] MY_ARG
Long and useful description of the command and stuff.
Options:
-h, --help Show this message and exit.
The command is implemented roughly like so
@click.group()
@click.pass_context
def cli(ctx):
ctx.obj = {}
@cli.command()
@click.argument('my_arg')
@click.pass_context
@report_errors
def foo(ctx, my_arg):
# some stuff here