From 9f598b51e8f5695dfc7660cbedbf0ddab7b60269 Mon Sep 17 00:00:00 2001 From: Dimitris Zlatanidis Date: Tue, 10 Jan 2023 17:46:16 +0200 Subject: [PATCH] Added usage --- slpkg/views/cli_menu.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/slpkg/views/cli_menu.py b/slpkg/views/cli_menu.py index 07e0885c..d236fa7e 100644 --- a/slpkg/views/cli_menu.py +++ b/slpkg/views/cli_menu.py @@ -73,5 +73,8 @@ class Usage: def error_for_options(self, flags): """ Error message for flags. """ - raise SystemExit(f"\n{self.red}Error:{self.endc} Got an unexpected extra option, " + print(f'Usage: {Configs.prog_name} [{self.yellow}OPTIONS{self.endc}] ' + f'[{self.cyan}COMMAND{self.endc}] ') + print("Try 'slpkg --help' for help.\n") + raise SystemExit(f"{self.red}Error:{self.endc} Got an unexpected extra option, " f"please use: \n{self.yellow}{', '.join(flags)}{self.endc}\n")