Don't print usage on unknown command

Usage has grown pretty long and it obscures the error message.
pull/281/head
Ivan Habunek 2022-12-31 11:50:22 +01:00
rodzic c969848e7a
commit 4ef866dcbe
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: F5F0623FF5EBCB3D
1 zmienionych plików z 3 dodań i 3 usunięć

Wyświetl plik

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