From 4ef866dcbe7a247c0c4b827025851382f32609c0 Mon Sep 17 00:00:00 2001 From: Ivan Habunek Date: Sat, 31 Dec 2022 11:50:22 +0100 Subject: [PATCH] Don't print usage on unknown command Usage has grown pretty long and it obscures the error message. --- toot/console.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/toot/console.py b/toot/console.py index ac81224..55b5b7b 100644 --- a/toot/console.py +++ b/toot/console.py @@ -605,7 +605,7 @@ def print_usage(): print_out("") print_out("To get help for each command run:") - print_out(" toot --help") + print_out(" toot \\ --help") print_out("") print_out("{}".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 toot --help to show a list of available commands.") return parser = get_argument_parser(name, command)