From 1fece877e6293701f0f455ec93a22cf2483acde1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eray=20=C3=96zkural?= Date: Sun, 14 Aug 2005 15:59:39 +0000 Subject: [PATCH] * 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 --- pisi/cli/commands.py | 15 ++++++++------- pisi/cli/common.py | 2 -- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/pisi/cli/commands.py b/pisi/cli/commands.py index 39e55538..7fb19f40 100644 --- a/pisi/cli/commands.py +++ b/pisi/cli/commands.py @@ -111,7 +111,10 @@ class Command(object): def format_name(self): (name, shortname) = self.name() - return "%s (%s)" % (name, shortname) + if shortname: + return "%s (%s)" % (name, shortname) + else: + return name def help(self): """print help for the command""" @@ -126,21 +129,19 @@ class Command(object): class Help(Command): - """Prints help for a given command + """Prints help Usage: help ... If run without parameters will print the general usage 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): #TODO? Discard Help's own usage doc in favor of general usage doc #self.__doc__ = usage_text - self.__doc__ += commands_string() + #self.__doc__ += commands_string() super(Help, self).__init__() def name(self): diff --git a/pisi/cli/common.py b/pisi/cli/common.py index cf2cef0d..dafc30c7 100644 --- a/pisi/cli/common.py +++ b/pisi/cli/common.py @@ -16,8 +16,6 @@ where is one of: usage_text2 = """ Use \"%prog help \" for help on a specific command. - -PiSi Package Manager """ def commonopts(parser):