[ python-Feature Requests-1527705 ] optparse should support arbitrary number of arguments

SourceForge.net noreply at sourceforge.net
Sun Mar 18 19:36:07 CET 2007


Feature Requests item #1527705, was opened at 2006-07-24 12:03
Message generated for change (Settings changed) made by gbrandl
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=355470&aid=1527705&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: Ritesh Raj Sarraf (riteshsarraf)
Assigned to: Greg Ward (gward)
Summary: optparse should support arbitrary number of arguments

Initial Comment:
Currently, the number of arguments an option 
can/should have, needs be defined.

This is done using "nagrs".

parser.add_option("", "--my-option", nargs=3)

The problem is that at times it isn't predictable how 
many arguments you'll be receiving.

I request the implementation of this feature in 
optparse, where the following could be possible.

parser.add_option("", "--my-option", nargs=*)

Thanks,
Ritesh

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

Comment By: Ritesh Raj Sarraf (riteshsarraf)
Date: 2007-03-16 09:18

Message:
Logged In: YES 
user_id=382018
Originator: YES

Thanks for clarifying Neal.

I've filed a bug with optik, #1681933

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

Comment By: Neal Norwitz (nnorwitz)
Date: 2007-03-16 07:47

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

I encourage you to file a feature request with optik if it's important to
you.

While it may not be the nicest way, it's the only way we can get anything
done.  I pointed you to optik so you can file the feature request if it's
important to you.  What has happened in the past is that this report would
be left open forever.  That is worse.

If you think this is wrong, you can fix the problem by helping us resolve
all the issues in python.  Otherwise, there's no hope of us managing it.

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

Comment By: Ritesh Raj Sarraf (riteshsarraf)
Date: 2007-03-16 07:37

Message:
Logged In: YES 
user_id=382018
Originator: YES

I don't think this is the correct way of resolving a bug. You mark it as
"Close" with a resolution "Invalid" when the bug was filed against "Python
Library", of which optparse is one. Python ships optparse as part of its
libraries.

If internally, it is a separate project, you could file one there and link
to it.
But why just plain close it ?

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

Comment By: Neal Norwitz (nnorwitz)
Date: 2007-03-16 06:44

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

Optik is maintained separately.  Please file a feature request there: 
http://sourceforge.net/projects/optik

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

Comment By: Georg Brandl (gbrandl)
Date: 2006-07-24 13:31

Message:
Logged In: YES 
user_id=849994

I share effbot's view on that, but leaving to Greg to
decide. In any case, this is a feature request.

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

Comment By: Ritesh Raj Sarraf (riteshsarraf)
Date: 2006-07-24 13:21

Message:
Logged In: YES 
user_id=382018

Can you please go through the following link and give your 
comments ?

http://groups.google.com/group/comp.lang.python/browse_thre
ad/thread/277522927334b8d8

I feel its a valid feature request.

Ritesh

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

Comment By: Georg Brandl (gbrandl)
Date: 2006-07-24 12:57

Message:
Logged In: YES 
user_id=849994

I don't know of any program that uses command line switches
with a variable number of args, partly because you then
cannot distinguish between option arguments and normal
arguments.

I you still need this, you can implement a custom callback,
I think.

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

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


More information about the Python-bugs-list mailing list