Don't print usage on unknown command

Usage has grown pretty long and it obscures the error message.
This commit is contained in:
Ivan Habunek 2022-12-31 11:50:22 +01:00
parent c969848e7a
commit 4ef866dcbe
No known key found for this signature in database
GPG Key ID: F5F0623FF5EBCB3D
1 changed files with 3 additions and 3 deletions

View File

@ -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))
@ -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)