From 5144bf6c7997980a2f64dbfac58b5626034bb902 Mon Sep 17 00:00:00 2001 From: Jordan ERNST Date: Fri, 20 May 2022 12:54:44 +0200 Subject: [PATCH] Add: --update --help --- pendora-box.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/pendora-box.py b/pendora-box.py index 614fcbc..75b1909 100644 --- a/pendora-box.py +++ b/pendora-box.py @@ -1,3 +1,4 @@ +import argparse import json from pathlib import Path import hashlib @@ -432,10 +433,16 @@ def menu_choice(menu_options): if __name__ == '__main__': + + parser = argparse.ArgumentParser(description='Sync your files and starts a listener on HTTP, SMB or SMB2.') + parser.add_argument('-u', '--update', action='store_true', help='update your files (described in config.json)') + args = parser.parse_args() + with open("config.json", "r") as jsonfile: config = json.load(jsonfile) - update(config) + if args.update: + update(config) tmp = Path('files/tmp') is_empty = not any(tmp.iterdir()) if not is_empty: