sierra.core.cmdline

Core command line parsing and validation classes.

  • ArgumentParser: SIERRA’s argument parser overriding default argparse behavior.

  • BaseCmdline: The base cmdline definition class for SIERRA for reusability.

  • BootstrapCmdline: Defines the arguments that are used to bootstrap SIERRA/load plugins.

  • CoreCmdline: Defines the core command line arguments for SIERRA using argparse.

class sierra.core.cmdline.ArgumentParser(prog=None, usage=None, description=None, epilog=None, parents=[], formatter_class=<class 'argparse.HelpFormatter'>, prefix_chars='-', fromfile_prefix_chars=None, argument_default=None, conflict_handler='error', add_help=True, allow_abbrev=True, exit_on_error=True)[source]

SIERRA’s argument parser overriding default argparse behavior.

Delivers a custom help message without listing options, as the options which SIERRA accepts differs dramatically depending on loaded plugins.

Inheritance

Inheritance diagram of ArgumentParser
__doc__ = "SIERRA's argument parser overriding default argparse behavior.\n\n    Delivers a custom help message without listing options, as the options which\n    SIERRA accepts differs dramatically depending on loaded plugins.\n\n    "
__module__ = 'sierra.core.cmdline'
error(message: string)[source]

Prints a usage message incorporating the message to stderr and exits.

If you override this in a subclass, it should not return – it should either exit or raise an exception.

kHelpMsg = "Usage:\n\nsierra-cli [-v | --version] [OPTION]...\n\nWhat command line options SIERRA accepts depends on the loaded\n--project, --platform, --exec-env, and project-specific options.\n'man sierra-cli' will give you the full set of options that\ncomes with SIERRA.\n\n"
print_help(file=None)[source]
class sierra.core.cmdline.BaseCmdline[source]

The base cmdline definition class for SIERRA for reusability.

Inheritance

Inheritance diagram of BaseCmdline
__dict__ = mappingproxy({'__module__': 'sierra.core.cmdline', '__doc__': '\n    The base cmdline definition class for SIERRA for reusability.\n\n    ', 'stage_usage_doc': <staticmethod object>, 'bc_applicable_doc': <staticmethod object>, 'graphs_applicable_doc': <staticmethod object>, '__dict__': <attribute '__dict__' of 'BaseCmdline' objects>, '__weakref__': <attribute '__weakref__' of 'BaseCmdline' objects>, '__annotations__': {}})
__doc__ = '\n    The base cmdline definition class for SIERRA for reusability.\n\n    '
__module__ = 'sierra.core.cmdline'
__weakref__

list of weak references to the object (if defined)

static bc_applicable_doc(criteria: List[str]) str[source]
static graphs_applicable_doc(graphs: List[str]) str[source]
static stage_usage_doc(stages: List[int], omitted: str = 'If omitted: N/A.') str[source]
class sierra.core.cmdline.BootstrapCmdline[source]

Defines the arguments that are used to bootstrap SIERRA/load plugins.

Inheritance

Inheritance diagram of BootstrapCmdline
__doc__ = '\n    Defines the arguments that are used to bootstrap SIERRA/load plugins.\n    '
__init__() None[source]
__module__ = 'sierra.core.cmdline'
class sierra.core.cmdline.CoreCmdline(parents: Optional[List[ArgumentParser]], stages: List[int])[source]

Defines the core command line arguments for SIERRA using argparse.

Inheritance

Inheritance diagram of CoreCmdline
__doc__ = 'Defines the core command line arguments for SIERRA using :class:`argparse`.\n\n    '
__init__(parents: Optional[List[ArgumentParser]], stages: List[int]) None[source]
__module__ = 'sierra.core.cmdline'
init_cli(stages: List[int]) None[source]

Define cmdline arguments for stages 1-5.

init_multistage() None[source]

Define cmdline arguments which are used in multiple pipeline stages.

init_stage1() None[source]

Define cmdline arguments for stage 1.

init_stage2() None[source]

Define cmdline arguments for stage 2.

init_stage3() None[source]

Define cmdline arguments for stage 3.

init_stage4() None[source]

Define cmdline arguments for stage 4.

init_stage5() None[source]

Define cmdline arguments for stage 5.

scaffold_cli(parents: Optional[List[ArgumentParser]]) None[source]

Scaffold CLI by defining the parser and common argument groups.