* subcommand specific option'lara basla
This commit is contained in:
@@ -0,0 +1,5 @@
|
|||||||
|
subcommand specific options don't work yet:
|
||||||
|
|
||||||
|
nebula:pisi$ pisi-cli --yala build tests/popt/pspec.xml
|
||||||
|
pisi-cli: error: no such option: --yala
|
||||||
|
nebula:pisi$
|
||||||
@@ -22,10 +22,7 @@ Use \"%prog help <subcommand>\" for help on a specific subcommand.
|
|||||||
PISI Package Manager
|
PISI Package Manager
|
||||||
"""
|
"""
|
||||||
|
|
||||||
class PisiCLI(object):
|
def commonopts(parser):
|
||||||
def __init__(self):
|
|
||||||
parser = OptionParser(usage=usage,version="%prog " + pisi.__version__)
|
|
||||||
|
|
||||||
parser.add_option("-D", "--destdir", action="store")
|
parser.add_option("-D", "--destdir", action="store")
|
||||||
parser.add_option("-u", "--username", action="store")
|
parser.add_option("-u", "--username", action="store")
|
||||||
parser.add_option("-p", "--password", action="store")
|
parser.add_option("-p", "--password", action="store")
|
||||||
@@ -39,6 +36,15 @@ class PisiCLI(object):
|
|||||||
parser.add_option("-n", "--dry-run", action="store_true", default=False,
|
parser.add_option("-n", "--dry-run", action="store_true", default=False,
|
||||||
help = "do not perform any action, just show what\
|
help = "do not perform any action, just show what\
|
||||||
would be done")
|
would be done")
|
||||||
|
return parser
|
||||||
|
|
||||||
|
class PisiCLI(object):
|
||||||
|
def __init__(self):
|
||||||
|
parser = OptionParser(usage=usage,
|
||||||
|
version="%prog " + pisi.__version__)
|
||||||
|
parser.allow_interspersed_args = False
|
||||||
|
parser = commonopts(parser)
|
||||||
|
|
||||||
(options, args) = parser.parse_args()
|
(options, args) = parser.parse_args()
|
||||||
|
|
||||||
self.parser = parser
|
self.parser = parser
|
||||||
|
|||||||
Reference in New Issue
Block a user