class documentation
class ValidatorParser(ConfigFileParser): (source)
Constructor: ValidatorParser(config_parser, argument_parser)
A parser that warns when unknown options are used. It must be created with a reference to the ArgumentParser object, so like:
parser = ArgumentParser(
prog='mysoft',
config_file_parser_class=ConfigParser,)
# Add the validator to the config file parser, this is arguably a hack.
parser._config_file_parser = ValidatorParser(parser._config_file_parser, parser)
| Note | |
Using this parser implies acting like ArgumentParser's option ignore_unknown_config_file_keys=True. So no need to explicitely mention it. |
| Method | __init__ |
Undocumented |
| Method | get |
Undocumented |
| Method | parse |
Undocumented |
| Instance Variable | argument |
Undocumented |
| Instance Variable | config |
Undocumented |