mirror of
https://gitlab.com/dslackw/slpkg.git
synced 2025-01-13 20:01:48 +01:00
Updated for none flags msg
This commit is contained in:
parent
ef53f4e768
commit
01e6aae836
2 changed files with 6 additions and 5 deletions
|
@ -142,9 +142,6 @@ class Argparse:
|
|||
|
||||
flags = commands[command]
|
||||
|
||||
if not flags:
|
||||
flags = ['Only the command: ' + command]
|
||||
|
||||
for opt in self.flags:
|
||||
if opt.startswith('--'):
|
||||
if opt not in flags and opt not in ['--help', '--version']:
|
||||
|
|
|
@ -76,5 +76,9 @@ class Usage:
|
|||
print(f'Usage: {Configs.prog_name} [{self.yellow}OPTIONS{self.endc}] '
|
||||
f'[{self.cyan}COMMAND{self.endc}] <packages>')
|
||||
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}")
|
||||
if flags:
|
||||
raise SystemExit(f"{self.red}Error:{self.endc} Got an unexpected extra option, "
|
||||
f"please use: \n{self.yellow}'{', '.join(flags)}'{self.endc}")
|
||||
|
||||
raise SystemExit(f"{self.red}Error:{self.endc} Got an unexpected extra option.")
|
||||
|
||||
|
|
Loading…
Reference in a new issue