view example/argparse_undefined.py @ 139:30abbd61ea5e

example
author Jeff Hammel <k0scist@gmail.com>
date Tue, 04 Nov 2014 15:56:54 -0800
parents
children c6aea14a3e2b
line wrap: on
line source

#!/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()