Add: --update --help
This commit is contained in:
parent
bd5d7a2647
commit
5144bf6c79
@ -1,3 +1,4 @@
|
|||||||
|
import argparse
|
||||||
import json
|
import json
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
import hashlib
|
import hashlib
|
||||||
@ -432,10 +433,16 @@ def menu_choice(menu_options):
|
|||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
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:
|
with open("config.json", "r") as jsonfile:
|
||||||
config = json.load(jsonfile)
|
config = json.load(jsonfile)
|
||||||
|
|
||||||
update(config)
|
if args.update:
|
||||||
|
update(config)
|
||||||
tmp = Path('files/tmp')
|
tmp = Path('files/tmp')
|
||||||
is_empty = not any(tmp.iterdir())
|
is_empty = not any(tmp.iterdir())
|
||||||
if not is_empty:
|
if not is_empty:
|
||||||
|
Loading…
Reference in New Issue
Block a user