logalyzer.util.Args(object)
class documentation
Part of logalyzer.util
(View In Hierarchy)
Convenience class by Edwin A. Suominen for compact and sensible commandline argument parsing. The code of this class, separate from the rest of this module and package, is dedicated to the public domain.
Usage: Construct an instance with a text description of your
application. Then call the instance for each option you want to add, with a
short letter (just a single letter) preceded by a single hyphen
("-"), a long option preceded by a pair of hyphens
("--"), a default value if the option isn't just
store_true
, and a text description of the option. There will
be a total of 3-4 arguments.
You will access the option value using the short letter value, which gives you 26 possibilities for options (52 if you use both upper and lowercase). If you need more than that, you may be overcomplicating your command line.
Call the instance with just one argument, a text description, to allow for positional arguments. The arguments will be accessed from the instance as sequence items.
The instance will look exactly like an
argparse.ArgumentParser
object, all set up and ready to have
its attributes accessed.
Method | __init__ | Undocumented |
Method | __nonzero__ | Undocumented |
Method | addDefault | Undocumented |
Method | __call__ | Undocumented |
Method | __iter__ | Undocumented |
Method | __len__ | Undocumented |
Method | __getitem__ | Undocumented |
Method | __getattr__ | Undocumented |