265: Fixed small formatting error with use of CLI.print_commands()

This commit is contained in:
Jason Gerard DeRose 2008-09-04 09:27:28 +00:00
parent 553b0c596d
commit 22d9b8c078

View File

@ -107,6 +107,7 @@ class CLI(object):
print '\nSpecial CLI commands:'
for cmd in self.api.Application():
self.print_cmd(cmd)
print ''
def print_cmd(self, cmd):
print ' %s %s' % (
@ -114,8 +115,6 @@ class CLI(object):
cmd.doc,
)
def __contains__(self, key):
assert self.__d is not None, 'you must call finalize() first'
return key in self.__d
@ -139,12 +138,11 @@ class CLI(object):
(c.name.replace('_', '-'), c) for c in self.api.Command()
)
def run(self):
self.finalize()
if len(sys.argv) < 2:
self.print_commands()
print '\nUsage: ipa COMMAND'
print 'Usage: ipa COMMAND'
sys.exit(2)
key = sys.argv[1]
if key not in self: