* handle absence of short command names (might not need one)
* remove a useless line from usage text * don't print list of commands for pisi help help
This commit is contained in:
@@ -111,7 +111,10 @@ class Command(object):
|
|||||||
|
|
||||||
def format_name(self):
|
def format_name(self):
|
||||||
(name, shortname) = self.name()
|
(name, shortname) = self.name()
|
||||||
return "%s (%s)" % (name, shortname)
|
if shortname:
|
||||||
|
return "%s (%s)" % (name, shortname)
|
||||||
|
else:
|
||||||
|
return name
|
||||||
|
|
||||||
def help(self):
|
def help(self):
|
||||||
"""print help for the command"""
|
"""print help for the command"""
|
||||||
@@ -126,21 +129,19 @@ class Command(object):
|
|||||||
|
|
||||||
|
|
||||||
class Help(Command):
|
class Help(Command):
|
||||||
"""Prints help for a given command
|
"""Prints help
|
||||||
|
|
||||||
Usage: help <command1> <command2> ... <commandn>
|
Usage: help <command1> <command2> ... <commandn>
|
||||||
|
|
||||||
If run without parameters will print the general usage documentation.
|
If run without parameters will print the general usage documentation.
|
||||||
|
|
||||||
If run with a command name as the parameter will print the documentation
|
If run with a command name as the parameter will print the documentation
|
||||||
for that command, where command is one of:
|
for that command."""
|
||||||
|
|
||||||
"""
|
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
#TODO? Discard Help's own usage doc in favor of general usage doc
|
#TODO? Discard Help's own usage doc in favor of general usage doc
|
||||||
#self.__doc__ = usage_text
|
#self.__doc__ = usage_text
|
||||||
self.__doc__ += commands_string()
|
#self.__doc__ += commands_string()
|
||||||
super(Help, self).__init__()
|
super(Help, self).__init__()
|
||||||
|
|
||||||
def name(self):
|
def name(self):
|
||||||
|
|||||||
@@ -16,8 +16,6 @@ where <command> is one of:
|
|||||||
|
|
||||||
usage_text2 = """
|
usage_text2 = """
|
||||||
Use \"%prog help <command>\" for help on a specific command.
|
Use \"%prog help <command>\" for help on a specific command.
|
||||||
|
|
||||||
PiSi Package Manager
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def commonopts(parser):
|
def commonopts(parser):
|
||||||
|
|||||||
Reference in New Issue
Block a user