* use OptionParser.print_help() properly

This commit is contained in:
Eray Özkural
2005-08-09 15:14:54 +00:00
parent e5370d42a8
commit c16b02a2e0
3 changed files with 5 additions and 7 deletions
+3 -5
View File
@@ -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
View File
@@ -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
View File
@@ -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 :)