Can optparse do dependencies?

Bob bob.python at yahoo.com
Sat Feb 25 11:39:42 EST 2006


I'd like to setup command line switches that are dependent on other
switches, similar to what rpm does listed below. From the grammar below
we see that the "query-options" are dependent on the query switch,
{-q|--query}. Can "optparse" do this or do I have to code my own
"thing"? Thanks.

QUERYING AND VERIFYING PACKAGES:
       rpm {-q|--query} [select-options] [query-options]
...
   query-options
        [--changelog] [-c,--configfiles] [-d,--docfiles] [--dump]
        [--filesbypkg] [-i,--info] [--last] [-l,--list]
        [--provides] [--qf,--queryformat QUERYFMT]
        [-R,--requires] [--scripts] [-s,--state]
        [--triggers,--triggerscripts]




More information about the Python-list mailing list