mirror of
https://gitlab.com/dslackw/slpkg.git
synced 2025-01-30 20:34:38 +01:00
Fixed arguments with flags
This commit is contained in:
parent
94fc303bb7
commit
78d6b0916b
1 changed files with 16 additions and 7 deletions
|
@ -32,13 +32,13 @@ class Argparse:
|
|||
def flag(self):
|
||||
self.flags = []
|
||||
|
||||
options = ['--yes',
|
||||
'--jobs',
|
||||
'--resolve-off',
|
||||
'--reinstall'
|
||||
]
|
||||
self.options = ['--yes',
|
||||
'--jobs',
|
||||
'--resolve-off',
|
||||
'--reinstall'
|
||||
]
|
||||
|
||||
for option in options:
|
||||
for option in self.options:
|
||||
if option in self.args:
|
||||
self.args.remove(option)
|
||||
self.flags.append(option)
|
||||
|
@ -63,7 +63,7 @@ class Argparse:
|
|||
usage(1)
|
||||
|
||||
def build(self):
|
||||
if len(self.args) >= 2:
|
||||
if len(self.args) >= 2 and '--reinstall' not in self.flags:
|
||||
packages = list(set(self.args[1:]))
|
||||
|
||||
self.check.exists(packages)
|
||||
|
@ -87,6 +87,9 @@ class Argparse:
|
|||
usage(1)
|
||||
|
||||
def remove(self):
|
||||
if [f for f in self.flags if f in self.options[1:]]:
|
||||
usage(1)
|
||||
|
||||
if len(self.args) >= 2:
|
||||
packages = list(set(self.args[1:]))
|
||||
packages = self.check.blacklist(packages)
|
||||
|
@ -99,6 +102,9 @@ class Argparse:
|
|||
usage(1)
|
||||
|
||||
def search(self):
|
||||
if [f for f in self.flags if f in self.options]:
|
||||
usage(1)
|
||||
|
||||
if len(self.args) >= 2:
|
||||
packages = list(set(self.args[1:]))
|
||||
packages = self.check.blacklist(packages)
|
||||
|
@ -111,6 +117,9 @@ class Argparse:
|
|||
usage(1)
|
||||
|
||||
def find(self):
|
||||
if [f for f in self.flags if f in self.options]:
|
||||
usage(1)
|
||||
|
||||
if len(self.args) >= 2:
|
||||
packages = list(set(self.args[1:]))
|
||||
packages = self.check.blacklist(packages)
|
||||
|
|
Loading…
Add table
Reference in a new issue