s1etad.cli.utils module

Utility functions for the management of command line arguments.

s1etad.cli.utils.finalize_parser(parser)[source]

Finalize the argument parser provided in input.

Arguments for logging control and version printing are added. If the “argcomplete” module is available the automatic completion for the parser is also set-up.

The updated parser is returned.

s1etad.cli.utils.get_function(func)[source]

Return the function corresponding to the input.

If the input func parameter is already a callable then it is immediately returned.

If the input is a string in the form “modname.[…].funcname” then the required Python package/module is imported and the specified function (“funcname” in the example) is returned.

s1etad.cli.utils.get_kwargs(args)[source]

Convert an argparse.Namespace into a dictionary.

The “loglevel” and “func” arguments are never included in the output dictionary.

s1etad.cli.utils.set_logging_control_args(parser, default_loglevel='WARNING')[source]

Set up command line options for logging control.