Skip to content

Commit

Permalink
Don't print usage on unknown command
Browse files Browse the repository at this point in the history
Usage has grown pretty long and it obscures the error message.
  • Loading branch information
ihabunek committed Dec 31, 2022
1 parent c969848 commit 4ef866d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions toot/console.py
Original file line number Diff line number Diff line change
Expand Up @@ -605,7 +605,7 @@ def print_usage():

print_out("")
print_out("To get help for each command run:")
print_out(" <yellow>toot <command> --help</yellow>")
print_out(" <yellow>toot \\<command> --help</yellow>")
print_out("")
print_out("<green>{}</green>".format(CLIENT_WEBSITE))

Expand All @@ -630,8 +630,8 @@ def run_command(app, user, name, args):
command = next((c for c in COMMANDS if c.name == name), None)

if not command:
print_err("Unknown command '{}'\n".format(name))
print_usage()
print_err(f"Unknown command '{name}'")
print_out("Run <yellow>toot --help</yellow> to show a list of available commands.")
return

parser = get_argument_parser(name, command)
Expand Down

0 comments on commit 4ef866d

Please sign in to comment.