mirror of
https://gitlab.com/dslackw/slpkg.git
synced 2025-02-11 20:48:11 +01:00
update arguments
This commit is contained in:
parent
c425b43360
commit
9b6949499f
2 changed files with 25 additions and 3 deletions
|
@ -73,7 +73,7 @@ def usage():
|
||||||
" [-b --list, [...] --add, --remove]",
|
" [-b --list, [...] --add, --remove]",
|
||||||
" [-q --list, [...] --add, --remove]",
|
" [-q --list, [...] --add, --remove]",
|
||||||
" [-q --build, --install, --build-install]",
|
" [-q --build, --install, --build-install]",
|
||||||
" [-l all, sbo, slack, noarch]",
|
" [-l <repository>, all, noarch]",
|
||||||
" [-c <repository> --upgrade --current]",
|
" [-c <repository> --upgrade --current]",
|
||||||
" [-s <repository> <package> --current]",
|
" [-s <repository> <package> --current]",
|
||||||
" [-f] [-t] [-n] [-i [...]] [-u [...]]",
|
" [-f] [-t] [-n] [-i [...]] [-u [...]]",
|
||||||
|
|
|
@ -45,6 +45,21 @@ from others.check import OthersUpgrade
|
||||||
from others.install import OthersInstall
|
from others.install import OthersInstall
|
||||||
|
|
||||||
|
|
||||||
|
class case(object):
|
||||||
|
|
||||||
|
def __init__(self, package):
|
||||||
|
self.package = package
|
||||||
|
|
||||||
|
def sboinstall(self):
|
||||||
|
SBoInstall(self.package).start()
|
||||||
|
|
||||||
|
def slackinstall(self):
|
||||||
|
Slack(self.package, "stable").start()
|
||||||
|
|
||||||
|
def rlwinstall(self):
|
||||||
|
OthersInstall(self.package, "rlw", "").start()
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
# root privileges required
|
# root privileges required
|
||||||
s_user(getpass.getuser())
|
s_user(getpass.getuser())
|
||||||
|
@ -92,7 +107,14 @@ def main():
|
||||||
else:
|
else:
|
||||||
usage()
|
usage()
|
||||||
elif len(args) == 3 and args[0] == "-s":
|
elif len(args) == 3 and args[0] == "-s":
|
||||||
if args[1] == repository[0]:
|
install = {
|
||||||
|
"sbo": case(args[2]).sboinstall,
|
||||||
|
"slack": case(args[2]).slackinstall,
|
||||||
|
"rlw": case(args[2]).rlwinstall
|
||||||
|
}
|
||||||
|
install[args[1]]()
|
||||||
|
|
||||||
|
'''if args[1] == repository[0]:
|
||||||
SBoInstall(args[2]).start()
|
SBoInstall(args[2]).start()
|
||||||
elif args[1] == repository[1]:
|
elif args[1] == repository[1]:
|
||||||
Slack(args[2], "stable").start()
|
Slack(args[2], "stable").start()
|
||||||
|
@ -103,7 +125,7 @@ def main():
|
||||||
elif args[1] == repository[4]:
|
elif args[1] == repository[4]:
|
||||||
OthersInstall(args[2], repository[4], "").start()
|
OthersInstall(args[2], repository[4], "").start()
|
||||||
else:
|
else:
|
||||||
usage()
|
usage()'''
|
||||||
elif len(args) == 4 and args[0] == "-s":
|
elif len(args) == 4 and args[0] == "-s":
|
||||||
if args[1] == repository[1] and args[3] == "--current":
|
if args[1] == repository[1] and args[3] == "--current":
|
||||||
Slack(args[2], "current").start()
|
Slack(args[2], "current").start()
|
||||||
|
|
Loading…
Add table
Reference in a new issue