changeset 139:30abbd61ea5e

example
author Jeff Hammel <k0scist@gmail.com>
date Tue, 04 Nov 2014 15:56:54 -0800
parents cae2a1e1b9da
children 372315b3bb8e
files example/argparse_undefined.py
diffstat 1 files changed, 19 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/example/argparse_undefined.py	Tue Nov 04 15:56:54 2014 -0800
@@ -0,0 +1,19 @@
+#!/usr/bin/env python
+
+"""
+illustrate which options are parsed with argparse
+"""
+
+import argparse
+import sys
+
+class UndefinedArgumentParser(argparse.ArgumentParser)
+
+def main(args=sys.argv[1:]):
+
+    parser = UndefinedArgumentParser()
+    parser.add_argument('--foo', dest='foo',
+                        help="foo")
+
+if __name__ == '__main__':
+    main()