diff options
author | V3n3RiX <venerix@redcorelinux.org> | 2018-11-09 21:10:25 +0000 |
---|---|---|
committer | V3n3RiX <venerix@redcorelinux.org> | 2018-11-09 21:10:25 +0000 |
commit | 6cb4daa56408c342d85df8e567581972fe7ba4c1 (patch) | |
tree | 99e420fb3f660de52b0a7bf80d1dadf9e232bcbd /src/frontend | |
parent | 9143739749bbabf33fcbf7d89667fc8ccf38d6a7 (diff) |
refuse to install/uninstall/force-uninstall/search if no package name is given
Diffstat (limited to 'src/frontend')
-rwxr-xr-x | src/frontend/cli/sisyphus-cli.py | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/src/frontend/cli/sisyphus-cli.py b/src/frontend/cli/sisyphus-cli.py index e7637cb..ff68593 100755 --- a/src/frontend/cli/sisyphus-cli.py +++ b/src/frontend/cli/sisyphus-cli.py @@ -8,11 +8,20 @@ pkgList = sys.argv[2:] if "__main__" == __name__: if sys.argv[1:]: if "install" in sys.argv[1:]: - startInstall(pkgList) + if not pkgList: + sys.exit("\n" + "Nothing to install, please give at least one package name; quitting" + "\n") + else: + startInstall(pkgList) elif "uninstall" in sys.argv[1:]: - startUninstall(pkgList) + if not pkgList: + sys.exit("\n" + "Nothing to uninstall, please give at least one package name; quitting" + "\n") + else: + startUninstall(pkgList) elif "force-uninstall" in sys.argv[1:]: - startUninstallForce(pkgList) + if not pkgList: + sys.exit("\n" + "Nothing to force uninstall, please give at least one package name; quitting" + "\n") + else: + startUninstallForce(pkgList) elif "remove-orphans" in sys.argv[1:]: removeOrphans() elif "update" in sys.argv[1:]: @@ -20,7 +29,10 @@ if "__main__" == __name__: elif "upgrade" in sys.argv[1:]: startUpgrade() elif "search" in sys.argv[1:]: - startSearch(pkgList) + if not pkgList: + sys.exit("\n" + "Nothing to search, please give at least one package name; quitting" + "\n") + else: + startSearch(pkgList) elif "spmsync" in sys.argv[1:]: startSyncSPM() elif "rescue" in sys.argv[1:]: |