* use OptionParser.print_help() properly
This commit is contained in:
@@ -45,8 +45,6 @@ class Command(object):
|
||||
|
||||
def __init__(self):
|
||||
# now for the real parser
|
||||
#usage_text = usage_text1 + commandsString() + usage_text2
|
||||
#self.usage_text = usage_text
|
||||
self.parser = OptionParser(usage=usage_text,
|
||||
version="%prog " + pisi.__version__)
|
||||
self.options()
|
||||
@@ -117,8 +115,7 @@ for that command.
|
||||
|
||||
def run(self):
|
||||
if not self.args:
|
||||
print usage_text
|
||||
print self.parser.format_option_help()
|
||||
self.parser.print_help()
|
||||
return
|
||||
|
||||
for arg in self.args:
|
||||
@@ -624,4 +621,5 @@ commands = {"help": Help,
|
||||
"list-repo": ListRepo
|
||||
}
|
||||
|
||||
usage_text = usage_text1 + commandsString() + usage_text2
|
||||
usage_text = (usage_text1 + commandsString() + usage_text2)
|
||||
|
||||
|
||||
+1
-1
@@ -61,7 +61,7 @@ class PisiCLI(object):
|
||||
self.die()
|
||||
|
||||
def die(self):
|
||||
print usage_text
|
||||
self.parser.print_help()
|
||||
sys.exit(1)
|
||||
|
||||
def runCommand(self):
|
||||
|
||||
+1
-1
@@ -247,7 +247,7 @@ def remove(A):
|
||||
if installdb.is_installed(x):
|
||||
operations.remove_single(x)
|
||||
else:
|
||||
ui.info('Package %s does not exist. Cannot remove.\n' % x)
|
||||
ui.info('Package %s is not installed. Cannot remove.\n' % x)
|
||||
|
||||
return True # everything went OK :)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user