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
This breaks existing programs like a2x when porting them to argparse from
the now-deprecated optparse.
http://bugs.python.org/issue9334
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