Hi,
Is it possible with argparse to have this syntax for a script?
my-script (-a -b VALUE-B | -c -d VALUE-D)
I would like to do this with the argparse module.
Thanks in advance.
--
François Lafont
--
http://mail.python.org/mailman/listinfo/python-list
Hello,
Up. ;-)
Le 04/08/2013 04:10, Francois Lafont a écrit :
> Is it possible with argparse to have this syntax for a script?
>
> my-script (-a -b VALUE-B | -c -d VALUE-D)
>
> I would like to do this with the argparse module.
>
> Thanks in advance.
I have f
Le 05/08/2013 16:11, Miki Tebeka a écrit :
> You can probably do something similar using sub commands
> (http://docs.python.org/2/library/argparse.html#sub-commands).
Yes, but this is not the same syntax. I want this syntax :
my-script (-a -b VALUE-B | -c -d VALUE-D)
I don't want this syntax:
Le 05/08/2013 22:01, Rafael Durán Castañeda a écrit :
> I think you are looking for exclusive groups:
>
> http://docs.python.org/2.7/library/argparse.html#argparse.add_mutually_exclusive_group
Yes... but no. The doc explains you can do this:
my-script (-b VALUE-B | -d VALUE-D)
ie mutally excl
Hi,
On relfection, it's clear that:
1. the "(-a -b VALUE-B | -c -d VALUE-D)" syntax is not
implemented by the argparse module;
2. and get this syntax with "argparse + hacking" is not very clean.
So, finally I'll use the docopt module version 0.6.1.
For the inheritance of common options, I'll us
Le 07/08/2013 01:18, Francois Lafont a écrit :
> For the inheritance of common options, I'll used something like
> that (even if I prefer the oriented object side of the argparse
> module):
But I admit that this is a very simple and intelligent module. ;-)
--
François L