diff options
| author | seth <[email protected]> | 2022-08-04 21:46:51 -0400 |
|---|---|---|
| committer | seth <[email protected]> | 2022-08-04 21:53:37 -0400 |
| commit | 4279c67fff1899abdf44d023569a71f3aec4f851 (patch) | |
| tree | e5039e3e1db17529435a6fe7591cf0836a966095 | |
| parent | e0bef4d397c0c88dd052466be2e12dc8b1d73813 (diff) | |
add --systemonly
--systemonly and -s will now only update packages through the system's
package manager
| -rwxr-xr-x | bin/hiccup | 18 |
1 files changed, 14 insertions, 4 deletions
@@ -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) |
