I think so. I do encounter the same problem pretty often and I end up
deciding which arguments should I use to "select" the exclusive group
and which to just make normal options (they get ignored by the code).
That's not perfect as the --help output won't show the correct syntax.
--
Mihai Rusu
Yeah, I don't see any obvious way to do this right now (other than the
post-hoc stuff you're probably already doing).
> If I want to have ( -f FILENAME | -i IP ), I already know how, so
> would there be a way to hack the help output to fake the rest of the
> text ("-u USER -p PASSWORD")? It would be nice if we could change the
> final text before it gets outputted, that way we can fake this kind of
> stuff in the meantime (until it gets implemented).
Probably the simplest thing is to override format_usage and/or
format_help, and munge the output to your desired form. If you're
feeling more ambitious, look at the definitions of these two methods,
and you can try modifying the calls to the formatter object directly.
And, of course, if you feel like implementing this properly in
argparse, patches are always welcome on bugs.python.org. ;-)
Steve
--
Where did you get that preposterous hypothesis?
Did Steve tell you that?
--- The Hiphopopotamus