click-default-group icon indicating copy to clipboard operation
click-default-group copied to clipboard

click-default-group breaks click-repl

Open oberstet opened this issue 8 years ago • 1 comments

From https://github.com/pallets/click/issues/430#issuecomment-282015177:

Using

@click.group(cls=DefaultGroup, default='shell', default_if_no_args=True)

breaks the auto-completion integration with prompt-toolkit from click-repl.

Why is it preferred versus the following anyway (which works, and does not break click-repl?

@click.group(invoke_without_command=True)
@click.option(
    '--profile',
    help='profile to use',
    default=u'default'
)
@click.pass_context
def cli(ctx, profile):
    ctx.obj = Config(_app, profile)
    if ctx.invoked_subcommand is None:
        ctx.invoke(cmd_shell)

oberstet avatar Feb 23 '17 15:02 oberstet

Why is it preferred versus the following

I tried that, and couldn't get all the arguments being passed to the subcommand to work.

jorhett avatar Mar 28 '22 20:03 jorhett