def debug_context(**kwargs): ctx = click.get_current_context() click_utils.inherit_parent_params(ctx, ("debug",)) debug_ = ctx.params["debug"] if debug_: click.echo("Debug mode: %s" % ("enabled" if debug_ else "disabled")) click_utils.echo_context(ctx) click_utils.echo_kwargs(kwargs) subcommand = ctx.invoked_subcommand click.echo("subcommand: %s" % subcommand)
def debug_context(**kwargs): ctx = click.get_current_context() # debug_ = ctx.params.get('debug') or ctx.parent.params.get('debug') if ctx.parent else False # if debug_: # echo_context(ctx) click_utils.inherit_parent_params(ctx, ('debug',)) debug_ = ctx.params['debug'] if debug_: click.echo('Debug mode: %s' % ('enabled' if debug_ else 'disabled')) click_utils.echo_context(ctx) click_utils.echo_kwargs(kwargs) subcommand = ctx.invoked_subcommand click.echo('subcommand: %s' % subcommand)