microprobe.utils.cmdline.LazyArgumentParser

class LazyArgumentParser(**kwargs)[source]

Bases: argparse.ArgumentParser

A Lazy argument parser.

An argument parser that first parses all the arguments provided and if any of them is not correct, an argument error is raided. This differs from the base class where parser stops right after the first argument error is reported.

__init__(**kwargs)[source]

Initialize self. See help(type(self)) for accurate signature.

Methods

__init__(**kwargs)

Initialize self.

add_argument()

add_argument_group(*args, **kwargs)

add_mutually_exclusive_group(**kwargs)

add_subparsers(**kwargs)

check_argument_errors()

Check for argument errors.

convert_arg_line_to_args(arg_line)

error(message)

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

exit([status, message])

force_error(msg)

param msg

format_help()

format_usage()

get_default(dest)

parse_args([args, namespace])

parse_intermixed_args([args, namespace])

parse_known_args([args, namespace])

parse_known_intermixed_args([args, namespace])

print_help([file])

print_usage([file])

register(registry_name, value, object)

set_defaults(**kwargs)




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.

check_argument_errors()[source]

Check for argument errors.

force_error(msg)[source]
Parameters

msg

add_argument(dest, ..., name=value, ...)
add_argument(option_string, option_string, ..., name=value, ...)None
add_argument_group(*args, **kwargs)
add_mutually_exclusive_group(**kwargs)
add_subparsers(**kwargs)
convert_arg_line_to_args(arg_line)
exit(status=0, message=None)
format_help()
format_usage()
get_default(dest)
parse_args(args=None, namespace=None)
parse_intermixed_args(args=None, namespace=None)
parse_known_args(args=None, namespace=None)
parse_known_intermixed_args(args=None, namespace=None)
print_help(file=None)
print_usage(file=None)
register(registry_name, value, object)
set_defaults(**kwargs)