From 4279c67fff1899abdf44d023569a71f3aec4f851 Mon Sep 17 00:00:00 2001 From: seth Date: Thu, 4 Aug 2022 21:46:51 -0400 Subject: add --systemonly --systemonly and -s will now only update packages through the system's package manager --- bin/hiccup | 18 ++++++++++++++---- 1 file 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) -- cgit v1.2.3