summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorseth <[email protected]>2022-08-04 21:46:51 -0400
committerseth <[email protected]>2022-08-04 21:53:37 -0400
commit4279c67fff1899abdf44d023569a71f3aec4f851 (patch)
treee5039e3e1db17529435a6fe7591cf0836a966095 /bin
parente0bef4d397c0c88dd052466be2e12dc8b1d73813 (diff)
add --systemonly
--systemonly and -s will now only update packages through the system's package manager
Diffstat (limited to 'bin')
-rwxr-xr-xbin/hiccup18
1 files changed, 14 insertions, 4 deletions
diff --git a/bin/hiccup b/bin/hiccup
index 0354e92..9d55ad3 100755
--- a/bin/hiccup
+++ b/bin/hiccup
@@ -1,4 +1,5 @@
#!/usr/bin/env python3
+import argparse
import json
import platform
import os
@@ -92,7 +93,19 @@ class CurrentDistro:
def run():
- CurrentDistro(current_distro).update_all()
+ distro = CurrentDistro(current_distro)
+
+ parser = argparse.ArgumentParser(
+ description='a python script to help keep you up to date')
+ parser.add_argument("--systemonly", "-s", action="store_true",
+ default=False, dest="systemonly",
+ help='only update through the system\'s package manager') # noqa: E501
+ args = parser.parse_args()
+
+ if args.systemonly:
+ return distro.update_system()
+
+ return distro.update_all()
if __name__ == '__main__':
@@ -105,6 +118,3 @@ if __name__ == '__main__':
except Exception as e:
print(repr(e))
exit(2)
-else:
- print('this script can only be run directly')
- exit(3)