Skip to content

Commit

Permalink
cleanup storm script a bit more
Browse files Browse the repository at this point in the history
  • Loading branch information
Nathan Marz committed Feb 4, 2012
1 parent b88a8fd commit 37d004a
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions bin/storm
Original file line number Diff line number Diff line change
Expand Up @@ -262,18 +262,16 @@ def print_commands():
print "\nHelp:", "\n\thelp", "\n\thelp <command>"
print "\nDocumentation for the storm client can be found at https://github.com/nathanmarz/storm/wiki/Command-line-client\n"

def print_usage(command=None, msg=None):
def print_usage(command=None):
"""Print one help message or list of available commands"""
if command != None:
print (
COMMANDS[command].__doc__ or
"No documentation provided for <%s>" % command
)
return

if msg != None:
print msg
print_commands()
if COMMANDS.has_key(command):
print (COMMANDS[command].__doc__ or
"No documentation provided for <%s>" % command)
else:
print "<%s> is not a valid command" % command
else:
print_commands()

def unknown_command(*args):
print "Unknown command: [storm %s]" % ' '.join(sys.argv[1:])
Expand Down

0 comments on commit 37d004a

Please sign in to comment.