Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #18549
| Path | csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!newsfeed.eweka.nl!eweka.nl!feeder3.eweka.nl!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail |
|---|---|
| Return-Path | <andrea.crotti.0@gmail.com> |
| X-Original-To | python-list@python.org |
| Delivered-To | python-list@mail.python.org |
| X-Spam-Status | OK 0.060 |
| X-Spam-Evidence | '*H*': 0.88; '*S*': 0.00; 'parser': 0.05; 'useful,': 0.15; '--help': 0.16; 'argparse,': 0.16; 'none"': 0.16; 'subject:values': 0.16; 'wrote:': 0.18; "doesn't": 0.22; 'header :In-Reply-To:1': 0.22; 'received:74.125.82.174': 0.24; 'code': 0.25; 'pass': 0.29; 'pm,': 0.29; "isn't": 0.33; 'message- id:@gmail.com': 0.33; 'header:User-Agent:1': 0.33; 'there': 0.33; 'it?': 0.33; 'to:addr:python-list': 0.34; 'probably': 0.34; 'received:74.125.82': 0.35; 'but': 0.37; 'received:74.125': 0.37; 'received:google.com': 0.37; "there's": 0.37; 'received:10.0.0': 0.38; 'option': 0.39; 'why': 0.39; 'to:addr:python.org': 0.40; 'show': 0.67; 'customized': 0.79; 'andrea': 0.84; 'opinion.': 0.84 |
| DKIM-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; bh=nDpl9A4/FgPuTDQ9zlLdcnhXnA6j86G+Kxgfh7yF1qg=; b=mwBf0mWjS/6APssCfXhbie/apyfYo1xQO1U/NnmEORwTidJbfRdfquIqI7xPnuJAnR DSAWTrwFClg5CfahG5Kl7TXcKKmsS+TJhcbhMtdboM5RgIagR/ZAwtaXKvIyqTiaUL/f DR3lbRt+qp9EO7+bCcV0HddTk8uotQNLQumqc= |
| Date | Thu, 05 Jan 2012 13:29:34 +0000 |
| From | Andrea Crotti <andrea.crotti.0@gmail.com> |
| User-Agent | Mozilla/5.0 (X11; Linux x86_64; rv:9.0) Gecko/20111224 Thunderbird/9.0.1 |
| MIME-Version | 1.0 |
| To | python-list@python.org |
| Subject | Re: argparse and default values |
| References | <4F05A489.1010604@gmail.com> |
| In-Reply-To | <4F05A489.1010604@gmail.com> |
| Content-Type | text/plain; charset=ISO-8859-1; format=flowed |
| Content-Transfer-Encoding | 7bit |
| X-BeenThere | python-list@python.org |
| X-Mailman-Version | 2.1.12 |
| Precedence | list |
| List-Id | General discussion list for the Python programming language <python-list.python.org> |
| List-Unsubscribe | <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe> |
| List-Archive | <http://mail.python.org/pipermail/python-list> |
| List-Post | <mailto:python-list@python.org> |
| List-Help | <mailto:python-list-request@python.org?subject=help> |
| List-Subscribe | <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.4450.1325770178.27778.python-list@python.org> (permalink) |
| Lines | 18 |
| NNTP-Posting-Host | 2001:888:2000:d::a6 |
| X-Trace | 1325770178 news.xs4all.nl 6904 [2001:888:2000:d::a6]:38839 |
| X-Complaints-To | abuse@xs4all.nl |
| Xref | x330-a1.tempe.blueboxinc.net comp.lang.python:18549 |
Show key headers only | View raw
On 01/05/2012 01:24 PM, Andrea Crotti wrote:
> There's one thing I don't understand about argparse, why doesn't
> --help show what is the default value??
> I mean if I add an option that can be customized it would be good for
> the user
> to know what is the current value in my opinion.
>
> Is there a way to make it show it?
Looking at the code I found it already
parser = argparse.ArgumentParser(description=description,
formatter_class=argparse.ArgumentDefaultsHelpFormatter)
the only thing is that it displays also "default: None" which isn't
probably very useful,
but it would easy to write my own formatter and pass it if I don't like
this..
Back to comp.lang.python | Previous | Next | Find similar | Unroll thread
Re: argparse and default values Andrea Crotti <andrea.crotti.0@gmail.com> - 2012-01-05 13:29 +0000
csiph-web