rotifer.core.cli.parser#

class rotifer.core.cli.parser(description='', add_help=True)[source]#

Bases: object

add(long_arg=None, short_arg=None, dest=None, nargs=None, const=None, default=None, arg_type=None, choices=None, helper=None, metavar=None, action='store', rconfig='', version='', **kw)[source]#

Add an argument to parser#

PARAMETERS: long_arg: long alias short_arg: short alias dest: value destination nargs: Number of args const: see argparse const default: Default value arg_type: argument type (no quotes) choices: offer a list of choices helper: Help message metavar: Metavar action: An action rconfig: Load pre-defined configurations ———— USAGE: Add your own argument: parser.add(long_arg = ‘–long’,

short_arg = ‘-short’, dest = ‘myvar’ )

parser.add(‘:cli.core’) # load predefined configuration parser.parse_args()

parse_args(exclude_from_dump=[], exclude_core=False)[source]#

Parse args Exclude one argument from configdump output IMPORTANT: Need to fix configfile ———– INPUT: exclude_from_dump: A list containing if you want to exclude from the output ———- OUTPUT: A parsed argument ——— USAGE: Simple usage: parser = corecli.parser() parser.add(‘:core’) args = parser.parse_args() return args

Advanced usage: parser = corecli.parser() parser.add(‘file’) parser.add(‘:core’) args = parser.parse_args(exclude_from_dump = [‘file’]) # File arguments not present in the output! return args