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 Lafont
--
http://mail.pyt
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 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
> I think you are looking for exclusive groups:
>
> http://docs.python.org/2.7/library/argparse.html#argparse.add_mutually_excl
> usive_group
No. That links first doc line in that method shows the very point we are all
discussing:
"Create a mutually exclusive group. argparse will make sure that
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:
El 04/08/13 04:10, Francois Lafont escribió:
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.
I think you are looking for exclusive groups:
http://docs.python.o
> You can probably do something similar using sub commands
> (http://docs.python.org/2/library/argparse.html#sub-commands).
The problem here is that argparse does not pass the subparser into the
parsed args and shared args between subparsers need to be declared
each time. Come execution time, when
> 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.
You can probably do something similar using sub commands
(http://docs.python.org/2/library/argparse.html#sub-commands).
--
http://mai
On 5 August 2013 03:05, Francois Lafont wrote:
> 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.
>
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 found this post:
https://groups.goo
10 matches
Mail list logo