mirror of
https://gitlab.com/dslackw/slpkg.git
synced 2025-02-06 08:46:21 +01:00
Removed unused method
This commit is contained in:
parent
0b3e813dd1
commit
f683d8cf6c
2 changed files with 0 additions and 22 deletions
|
@ -334,14 +334,6 @@ class Argparse(Configs):
|
||||||
self.args.remove(opt)
|
self.args.remove(opt)
|
||||||
self.flags.append(opt)
|
self.flags.append(opt)
|
||||||
|
|
||||||
def check_for_flags(self, command: str) -> None:
|
|
||||||
""" Check for correct flags. """
|
|
||||||
flags: list = self.commands[command]
|
|
||||||
|
|
||||||
for opt in self.flags:
|
|
||||||
if opt not in flags and opt not in ['--help', '--version']:
|
|
||||||
self.usage.error_for_options(command, flags)
|
|
||||||
|
|
||||||
def is_file_list_packages(self):
|
def is_file_list_packages(self):
|
||||||
""" Checks if the arg is filelist.pkgs. """
|
""" Checks if the arg is filelist.pkgs. """
|
||||||
if self.args[1].endswith(self.file_list_suffix):
|
if self.args[1].endswith(self.file_list_suffix):
|
||||||
|
@ -717,7 +709,6 @@ def main():
|
||||||
}
|
}
|
||||||
|
|
||||||
try:
|
try:
|
||||||
argparse.check_for_flags(args[0])
|
|
||||||
arguments[args[0]]()
|
arguments[args[0]]()
|
||||||
except (KeyError, IndexError):
|
except (KeyError, IndexError):
|
||||||
usage.help_short()
|
usage.help_short()
|
||||||
|
|
|
@ -92,16 +92,3 @@ class Usage(Configs):
|
||||||
|
|
||||||
print(args)
|
print(args)
|
||||||
raise SystemExit(status)
|
raise SystemExit(status)
|
||||||
|
|
||||||
def error_for_options(self, command: str, flags: list) -> NoReturn:
|
|
||||||
""" Error messages for flags. """
|
|
||||||
flags.reverse() # Put first the short options.
|
|
||||||
print(f'Usage: {self.prog_name} [{self.yellow}OPTIONS{self.endc}] '
|
|
||||||
f'[{self.cyan}COMMAND{self.endc}] [FILELIST|PACKAGES...]\n'
|
|
||||||
f"Try 'slpkg --help' for help.\n")
|
|
||||||
|
|
||||||
print(f"{self.bold}{self.red}Error:{self.endc} Got an unexpected extra option.\n"
|
|
||||||
f"\n{self.bold}COMMAND:{self.endc} {self.cyan}{command}{self.endc}"
|
|
||||||
f"\n{self.bold}OPTIONS:{self.endc} {self.yellow}{', '.join(flags)}{self.endc}\n")
|
|
||||||
print('If you need more information try to use slpkg manpage.')
|
|
||||||
raise SystemExit(1)
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue