dlhub_cli.parsing package

Submodules

dlhub_cli.parsing.click_wrappers module

Mostly copied from globus-cli and globus-search-cli We want the niceties of parsing improvements worked out in that project.

class dlhub_cli.parsing.click_wrappers.CommandState

Bases: object

class dlhub_cli.parsing.click_wrappers.DLHubCommandGroup(name=None, commands=None, **attrs)

Bases: click.core.Group

This is a click.Group with any customizations which we deem necessary everywhere. In particular, at present it provides a better form of handling for no_args_is_help. If that flag is set, helptext will be triggered not only off of cases where there are no arguments at all, but also cases where there are options, but no subcommand (positional arg) is given.

invoke(ctx)

Given a context, this invokes the attached callback (if it exists) in the right way.

class dlhub_cli.parsing.click_wrappers.HiddenOption(param_decls=None, show_default=False, prompt=False, confirmation_prompt=False, hide_input=False, is_flag=None, flag_value=None, multiple=False, count=False, allow_from_autoenv=True, type=None, help=None, **attrs)

Bases: click.core.Option

HiddenOption – absent from Help text. Supported in latest and greatest version of Click, but not old versions, so use generic ‘cls=HiddenOption’ to get the desired behavior.

get_help_record(ctx)

Has “None” as its help record. All that’s needed.

Parameters:ctx
Returns:
dlhub_cli.parsing.click_wrappers.common_options(f)

Global/shared options decorator.

Parameters:f
Returns:
dlhub_cli.parsing.click_wrappers.debug_option(f)

Enable debugging for commands.

Parameters:f
Returns:
dlhub_cli.parsing.click_wrappers.dlhub_cmd(*args, **kwargs)

Wrapper over click.command which sets common opts

Parameters:
  • args
  • kwargs
Returns:

dlhub_cli.parsing.click_wrappers.dlhub_group(*args, **kwargs)

Wrapper over click.group which sets GlobusCommandGroup as the Class

Parameters:
  • args
  • kwargs
Returns:

dlhub_cli.parsing.click_wrappers.index_argument(f)

Click indexing for arguments.

Parameters:f
Returns:
dlhub_cli.parsing.click_wrappers.setup_logging(level='DEBUG')

Configure the logger.

Parameters:level
Returns:

dlhub_cli.parsing.main module

dlhub_cli.parsing.main.main_func(f)

Wrap root command func in common opts and make it a command group

Parameters:f
Returns:

Module contents

dlhub_cli.parsing.index_argument(f)

Click indexing for arguments.

Parameters:f
Returns:
dlhub_cli.parsing.dlhub_group(*args, **kwargs)

Wrapper over click.group which sets GlobusCommandGroup as the Class

Parameters:
  • args
  • kwargs
Returns:

dlhub_cli.parsing.dlhub_cmd(*args, **kwargs)

Wrapper over click.command which sets common opts

Parameters:
  • args
  • kwargs
Returns:

dlhub_cli.parsing.main_func(f)

Wrap root command func in common opts and make it a command group

Parameters:f
Returns: