ska_sdp_piper.piper.command.cli_command_parser module

class ska_sdp_piper.piper.command.cli_command_parser.CLIArgument(*args, **kwargs)[source]

Bases: object

Model which holds information required to define a single command-line argument as per the ArgumentParser's add_argument() function API.

For more detalls, refer official python guide.

args: list

Arguments, as passed to the ArgumentParser.add_argument() function.

kwargs: dict

Key-word arguments, as passed to the ArgumentParser.add_argument()

class ska_sdp_piper.piper.command.cli_command_parser.CLICommandParser(version=None)[source]

Bases: object

Builds the argparser for CLI application initialisation

create_sub_parser(subparser_name, sub_command, cli_args, help=None)[source]

Creates sub parser.

Parameters:
  • subparser_name (str) -- Name of the sub parser.

  • sub_command (func) -- Function associated with the sub command.

  • cli_args ([CLIArgument]) -- List of CLI arguments associated with the sub command.

  • help (str) -- Help text for the sub command.

property cli_args_dict

Return dictionary containing CLI arguments

Return type:

dict

write_yml(path)[source]

Writes cli arguments to provided path in yaml format.

Parameters:

path (str) -- Location of config file to write to.