[issue12284] argparse.ArgumentParser: usage example option

2017-03-13 Thread Martin Panter

Changes by Martin Panter :


--
resolution:  -> works for me
stage: needs patch -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12284] argparse.ArgumentParser: usage example option

2014-07-16 Thread Mark Lawrence

Mark Lawrence added the comment:

@Jonas do you wish to follow up on this?

--
nosy: +BreamoreBoy, paul.j3

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12284] argparse.ArgumentParser: usage example option

2011-12-15 Thread Steven Bethard

Steven Bethard  added the comment:

%(prog)s is available in epilog:

-- temp.py --
import argparse

epilog = """\
Example usage:
  %(prog)s option1 option2
"""
parser = argparse.ArgumentParser(
formatter_class=argparse.RawTextHelpFormatter,
epilog=epilog)
parser.parse_args()
--
$ python temp.py -h
usage: temp.py [-h]

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

Example usage:
  temp.py option1 option2
--

Did you need more than that?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12284] argparse.ArgumentParser: usage example option

2011-06-09 Thread Brian Curtin

Changes by Brian Curtin :


--
stage:  -> needs patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12284] argparse.ArgumentParser: usage example option

2011-06-09 Thread Jonas H.

Jonas H.  added the comment:

Nope. I want an "examples" section, for example from `man git log`:


EXAMPLES
   git log --no-merges
   Show the whole commit history, but skip any merges

   git log v2.6.12.. include/scsi drivers/scsi
   Show all commits since version v2.6.12 that changed any file in the 
include/scsi or drivers/scsi subdirectories

   ...

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12284] argparse.ArgumentParser: usage example option

2011-06-09 Thread Éric Araujo

Éric Araujo  added the comment:

Is http://docs.python.org/dev/library/argparse#usage what you want?

--
nosy: +eric.araujo
versions: +Python 3.3 -Python 2.7

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12284] argparse.ArgumentParser: usage example option

2011-06-08 Thread R. David Murray

Changes by R. David Murray :


--
nosy: +bethard

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12284] argparse.ArgumentParser: usage example option

2011-06-08 Thread Jonas H.

New submission from Jonas H. :

I'd like to see an `examples` option added to argparse.ArgumentParser as found 
in many man pages.

This could also be done using the `epilog` option, but that misses the 
"%(proc)s" replacement which makes usage examples like this

  Example usage:
./script.py option1 option2

impossible.

--
components: Library (Lib)
messages: 137905
nosy: jonash
priority: normal
severity: normal
status: open
title: argparse.ArgumentParser: usage example option
type: feature request
versions: Python 2.7

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com