Issue 68 in argparse: Value passed to command-line option cannot take a string that includes another command-line option

1 view
Skip to first unread message

argp...@googlecode.com

unread,
Mar 24, 2010, 11:58:18 AM3/24/10
to argpar...@googlegroups.com
Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 68 by amnorvend: Value passed to command-line option cannot take
a string that includes another command-line option
http://code.google.com/p/argparse/issues/detail?id=68

What steps will reproduce the problem?

I have a program that will run other programs. I'd like to be able to pass
in the arguments to the other program from the commandline like so:

envb py.nosetest -a '-a unit'
envb py.nosetest --nose-arguments='-a unit'

If it's any help, here's the add_argument call:

parser.add_argument('-a', '--nose-arguments',
help = "Arguments to pass to nose")

What is the expected output? What do you see instead?

There's not really any expected output at this point as this is an
experiment. However, I'm currently getting the following error for the
first version:

usage: envb py.nosetest [-h] [-p PARCELS] [-v VERBOSE] [--version]
[-a NOSE_ARGUMENTS]
envb py.nosetest: error: argument -a/--nose-arguments: expected one argument

It seems as though this error will come up if it contains any of the valid
one letter arguments. So this will also produce an error:

envb py.nosetest -a '-v unit'

...but this won't:

envb py.nosetest -a '-b unit'

What version of the product are you using? On what operating system?

I've verified that this happens under versions 1.1.0 and 1.0.1

--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings

argp...@googlecode.com

unread,
Jul 22, 2010, 6:17:33 PM7/22/10
to argpar...@googlegroups.com

Comment #1 on issue 68 by anders.kaseorg: Value passed to command-line
option cannot take a string that includes another command-line option
http://code.google.com/p/argparse/issues/detail?id=68

This breaks existing programs like a2x when porting them to argparse from
the now-deprecated optparse.

http://bugs.python.org/issue9334


argp...@googlecode.com

unread,
Jul 23, 2010, 9:39:19 AM7/23/10
to argpar...@googlegroups.com
Updates:
Status: Duplicate

Comment #2 on issue 68 by steven.bethard: Value passed to command-line

option cannot take a string that includes another command-line option
http://code.google.com/p/argparse/issues/detail?id=68

Moved to bugs.python.org

Reply all
Reply to author
Forward
0 new messages