Commit b25c31ea authored by Ed Baunton's avatar Ed Baunton

Implement bst help

parent e36001f9
Pipeline #23433572 passed with stages
in 29 minutes and 3 seconds
......@@ -189,10 +189,22 @@ def cli(context, **kwargs):
context.obj = App.create(dict(kwargs))
context.call_on_close(context.obj.cleanup)
@cli.command(short_help="Print usage information")
##################################################################
# Help Command #
##################################################################
@cli.command(name="help", short_help="Print usage information",
context_settings={"help_option_names": []})
@click.argument("arg", nargs=-1)
@click.pass_context
def help(ctx):
click.echo(ctx.parent.get_help())
def help_command(ctx, **kwargs):
click.echo(ctx.parent.get_help(), err=True)
# TODO support bst help <command> but currently
# seems non obvious how to do this with click.
if kwargs["arg"]:
click.echo("\n{} {} --help for more usage on a specific command\n".format(
ctx.parent.info_name, " ".join(kwargs["arg"])), err=True)
##################################################################
# Init Command #
......
......@@ -9,6 +9,7 @@ MAIN_COMMANDS = [
'build ',
'checkout ',
'fetch ',
'help ',
'init ',
'pull ',
'push ',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment