Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Python: Bugs
[issue15336] Argparse required arguments incorrectly displayed as optional arguments
 

Index | Next | Previous | View Flat


report at bugs

Jul 12, 2012, 12:43 PM


Views: 191
Permalink
[issue15336] Argparse required arguments incorrectly displayed as optional arguments

New submission from Raymond Hettinger <raymond.hettinger [at] gmail>:

In this script, '-x' is required argument:
------------------------------------------
import argparse
p = argparse.ArgumentParser()
p.add_argument('-x', required=True)
p.print_help()

However, the automatically generated help shows it as optional:
---------------------------------------------------------------
usage: ap_demo.py [-h] -x X

optional arguments:
-h, --help show this help message and exit
-x X

----------
components: Library (Lib)
messages: 165331
nosy: rhettinger
priority: normal
severity: normal
status: open
title: Argparse required arguments incorrectly displayed as optional arguments
type: behavior
versions: Python 2.7, Python 3.2, Python 3.3

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue15336>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com

Subject User Time
[issue15336] Argparse required arguments incorrectly displayed as optional arguments report at bugs Jul 12, 2012, 12:43 PM
    [issue15336] Argparse required arguments incorrectly displayed as optional arguments report at bugs Jul 12, 2012, 8:53 PM
    [issue15336] Argparse required arguments incorrectly displayed as optional arguments report at bugs Jul 14, 2012, 5:55 AM
    [issue15336] Argparse required arguments incorrectly displayed as optional arguments report at bugs Jul 22, 2012, 4:39 PM

  Index | Next | Previous | View Flat
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.