From bfce15dad7b69114f11761fa12d9fb92dacb4189 Mon Sep 17 00:00:00 2001 From: Difrex Date: Thu, 4 Aug 2016 11:10:36 +0300 Subject: [PATCH] --config option --- surok.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/surok.py b/surok.py index e74276c..c6cfe7e 100755 --- a/surok.py +++ b/surok.py @@ -8,8 +8,18 @@ from surok.templates import gen from surok.discovery import resolve from surok.system import reload_conf + # Load base configurations -f = open('conf/surok.json', 'r') +surok_conf = '/etc/surok/conf/surok.json' + +# Command line arguments +parser = argparse.ArgumentParser() +parser.add_argument('-c', '--config') +args = parser.parse_args() +if args.config: + surok_conf = args.config + +f = open(surok_conf, 'r') conf = json.loads(f.read()) print(conf) f.close()