.. describe:: cmdoption
- Describes a command line option or switch. Option argument names should be
- enclosed in angle brackets. Example::
+ Describes a Python command line option or switch. Option argument names
+ should be enclosed in angle brackets. Example::
.. cmdoption:: -m <module>
stash of Python modules. This scheme's name is derived from the idea of a
"home" directory on Unix, since it's not unusual for a Unix user to make their
home directory have a layout similar to :file:`/usr/` or :file:`/usr/local/`.
-This scheme can be used by anyone, regardless of the operating system their
-installing for.
+This scheme can be used by anyone, regardless of the operating system they
+are installing for.
Installing a new module distribution is as simple as ::
>>> class FooAction(argparse.Action):
... def __call__(self, parser, namespace, values, option_string=None):
- ... print '%r %r %r' % (namespace, values, option_string)
- ... setattr(namespace, self.dest, values)
+ ... print '%r %r %r' % (namespace, values, option_string)
+ ... setattr(namespace, self.dest, values)
...
>>> parser = argparse.ArgumentParser()
>>> parser.add_argument('--foo', action=FooAction)
Permissions History
-------------------
+- Brian Quinlan was given commit access on Jul 26 2010 by GFB,
+ for work related to PEP 3148.
+
+- Reid Kleckner was given commit access on Jul 11 2010 by GFB,
+ for work on the py3k-jit branch, at suggestion of the Unladen
+ Swallow team.
+
- Alexander Belopolsky was given commit access on May 25 2010
by MvL at suggestion of Mark Dickinson.