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

Mailing List Archive: Python: Bugs

[issue15336] Argparse required arguments incorrectly displayed as optional arguments

 

 

Python bugs RSS feed   Index | Next | Previous | View Threaded


report at bugs

Jul 12, 2012, 12:43 PM

Post #1 of 4 (216 views)
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


report at bugs

Jul 12, 2012, 8:53 PM

Post #2 of 4 (177 views)
Permalink
[issue15336] Argparse required arguments incorrectly displayed as optional arguments [In reply to]

Changes by Ezio Melotti <ezio.melotti [at] gmail>:


----------
nosy: +bethard, ezio.melotti
stage: -> needs patch

_______________________________________
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


report at bugs

Jul 14, 2012, 5:55 AM

Post #3 of 4 (180 views)
Permalink
[issue15336] Argparse required arguments incorrectly displayed as optional arguments [In reply to]

Changes by √Čric Araujo <merwok [at] netwok>:


----------
nosy: +eric.araujo

_______________________________________
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


report at bugs

Jul 22, 2012, 4:39 PM

Post #4 of 4 (169 views)
Permalink
[issue15336] Argparse required arguments incorrectly displayed as optional arguments [In reply to]

Changes by Steven Bethard <steven.bethard [at] gmail>:


----------
resolution: -> duplicate
status: open -> closed
superseder: -> argparse: Default Help Message Lists Required Args As Optional

_______________________________________
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

Python bugs RSS feed   Index | Next | Previous | View Threaded
 
 


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