summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJose M. Guisado <jguisado@soleta.eu>2022-02-01 09:02:11 +0100
committerJose M. Guisado <jguisado@soleta.eu>2022-02-01 09:44:42 +0100
commitecd735c9dca3b4f77c99619b46eeb23b9f799a4c (patch)
treed477f61819d31536c079cbb6aa21992494d949ef
parent355e6caad360f2a5acedb125a3f421b8aee7a2e0 (diff)
#1068 add -c/--config optional parameter
ogClient allows the user to specify the json config path with optional parameters -c / --config: ogclient -c /foo/bar/foobar.json If specified config file is malformed ogClient will fail to start.
-rwxr-xr-xogclient7
1 files changed, 6 insertions, 1 deletions
diff --git a/ogclient b/ogclient
index 0e7bca6..be7a7f1 100755
--- a/ogclient
+++ b/ogclient
@@ -44,6 +44,9 @@ def create_parser():
parser_event_logout.set_defaults(func=lambda x: send_event_dgram(f'session stop {x.user}'))
parser_event_logout.add_argument('user', type=str)
+ parser.add_argument('-c', '--config', default="",
+ help='ogClient JSON config file path')
+
return parser
@@ -54,7 +57,9 @@ def main():
args.func(args)
return
- if platform.system().lower() == 'linux':
+ if args.config:
+ config_path = args.config
+ elif platform.system().lower() == 'linux':
config_path = f'{ogClient.OG_PATH}ogclient/cfg/ogclient.json'
else:
config_path = './cfg/ogclient.json'