[ python-Feature Requests-1073198 ] Extension to optparse: options with optional arguments

SourceForge.net noreply at sourceforge.net
Sat Mar 19 18:08:38 CET 2005


Feature Requests item #1073198, was opened at 2004-11-25 09:18
Message generated for change (Settings changed) made by gward
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=355470&aid=1073198&group_id=5470

Category: Python Library
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: pollastri (pollastri)
Assigned to: Greg Ward (gward)
>Summary: Extension to optparse: options with optional arguments

Initial Comment:
When parsing command line options, I found very useful
to have an
option with a facultative value, able to do the following:

1-tell to me if the option was or was not seen on the
command line, return the value None if the option was
not seen;

2-if the option only was specified, return a default value.

3-if the option with a value was specified on the
command line, return the specified value;

A way to reach this goal can be the addition of a new
value for the options actions in module optparse, it
may be something like "store_with_default".





----------------------------------------------------------------------

Comment By: Greg Ward (gward)
Date: 2005-01-05 08:19

Message:
Logged In: YES 
user_id=14422

I don't know what "facultative" means, but what you want is
optional option arguments.  Don't worry, I want that feature
too, and have even started implementing it on a branch of
the Optik source repository.  See
http://sourceforge.net/tracker/?func=detail&aid=1050431&group_id=38019&atid=421100
for a similar feature request.

I'm leaving this open, since I haven't finished anything or
merged it into the Python CVS.  It could be a few months
before there's any action here, and it certainly won't
happen before Optik 1.6 / Python 2.5.  Might require Optik
2.0, in which case I'm not certain when it'll get into Python.


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=355470&aid=1073198&group_id=5470


More information about the Python-bugs-list mailing list