def help_command(**options): """ Prints out help for the commands. salmon help You can get help for one command with: salmon help -for STR """ if "for" in options: help_text = args.help_for_command(salmon.commands, options['for']) if help_text: print help_text else: args.invalid_command_message(salmon.commands, exit_on_error=True) else: print "Available commands:\n" print ", ".join(args.available_commands(salmon.commands)) print "\nUse salmon help -for <command> to find out more."
def test_help_for_command(): assert args.help_for_command(commands, "test") assert not args.help_for_command(commands, "badcommand")