Closed rajnathsah closed 3 years ago
If you use the make_click_shell
function instead of the @shell
decorator, you can do something like this:
import click
from click_shell import make_click_shell
@click.group(invoke_without_command=True)
@click.pass_context
def my_app(ctx):
if ctx.invoked_subcommand is None:
shell = make_click_shell(ctx, prompt='my-app> ', intro='Starting my app...')
shell.help_help = custom_help_command
shell.cmdloop()
def custom_help_command():
print("Custom help message for the help command")
if __name__ == '__main__':
my_app()
And likewise with shell.help_quit
and shell.help_exit
for the quit
and exit
commands.
Thanks, Let me try.
help shows undocumented command for exit, quit and help. Is there a way to add some document to these predefined command?