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

SourceForge.net noreply at sourceforge.net
Fri Mar 16 07:11:27 CET 2007


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

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Python Library
Group: None
>Status: Closed
>Resolution: Invalid
Priority: 5
Private: No
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: Neal Norwitz (nnorwitz)
Date: 2007-03-15 23:11

Message:
Logged In: YES 
user_id=33168
Originator: NO

Greg, since optik is maintained separately, it seems to make sense to
close this and possibly create a new report in optik. 
http://sourceforge.net/projects/optik .  Let me know if that's not how you
want to handle bugs/feature requests.

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

Comment By: Greg Ward (gward)
Date: 2005-01-05 05: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