21: ipa script: improved print_api(); added missing sys.exit() after print_api() call

This commit is contained in:
Jason Gerard DeRose 2008-07-20 18:50:40 +00:00
parent 14339cfae0
commit 97a3520d37

2
ipa
View File

@ -47,6 +47,7 @@ def print_api():
for n in obj.commands: for n in obj.commands:
print ' .%s()' % n print ' .%s()' % n
print '\nStats:'
print ' %d objects' % len(api.objects) print ' %d objects' % len(api.objects)
print ' %d commands' % len(api.commands) print ' %d commands' % len(api.commands)
@ -58,6 +59,7 @@ if len(sys.argv) < 2:
cmd = sys.argv[1] cmd = sys.argv[1]
if cmd == '_api_': if cmd == '_api_':
print_api() print_api()
sys.exit()
elif cmd not in api.commands: elif cmd not in api.commands:
print_commands() print_commands()
print 'ipa: ERROR: unknown command %r' % cmd print 'ipa: ERROR: unknown command %r' % cmd