[code.view]

[top] / python / PyMOTW / argparse / argparse_conflict_handler_resolve2.py

     #!/usr/bin/env python
     # encoding: utf-8
     #
     # Copyright (c) 2010 Doug Hellmann.  All rights reserved.
     #
     """
     """
     #end_pymotw_header
     
     import argparse
     
     parser = argparse.ArgumentParser(conflict_handler='resolve')
     
     parser.add_argument('-a', action="store")
     parser.add_argument('--long-b', '-b', action="store", help='Long and short together')
     parser.add_argument('-b', action="store", help='Short alone')
     
     print parser.parse_args(['-h'])
     

[top] / python / PyMOTW / argparse / argparse_conflict_handler_resolve2.py

contact | logmethods.com