mirror of
https://gitlab.com/dslackw/slpkg.git
synced 2024-12-27 09:58:10 +01:00
Updated for options checks
This commit is contained in:
parent
2bfa08572f
commit
afc6833512
2 changed files with 7 additions and 0 deletions
|
@ -1,6 +1,7 @@
|
|||
4.6.1 - 15/03/2023
|
||||
Updated:
|
||||
- For None args
|
||||
- Checks for options
|
||||
|
||||
Updated:
|
||||
- Dialog text help for dependencies
|
||||
|
|
|
@ -273,6 +273,7 @@ class Argparse(Configs):
|
|||
Puts the command first and options after.
|
||||
Result: ['-i', '-y', '-j', '-R']
|
||||
"""
|
||||
invalid_options: list = []
|
||||
for args in self.args:
|
||||
if args[0] == '-' and args[:2] != '--' and len(args) >= 3 and '=' not in args:
|
||||
self.args.remove(args)
|
||||
|
@ -281,9 +282,14 @@ class Argparse(Configs):
|
|||
if opt in self.commands.keys():
|
||||
self.args.insert(0, opt)
|
||||
continue
|
||||
elif opt not in self.options:
|
||||
invalid_options.append(opt)
|
||||
|
||||
self.args.append(opt)
|
||||
|
||||
if invalid_options:
|
||||
self.usage.help_short()
|
||||
|
||||
def split_options_from_args(self) -> None:
|
||||
""" Split options from arguments.
|
||||
|
||||
|
|
Loading…
Reference in a new issue