parser/healthcareio/params.py

21 lines
393 B
Python
Raw Permalink Normal View History

2019-11-06 20:37:26 +00:00
import sys
SYS_ARGS = {'context':''}
if len(sys.argv) > 1:
N = len(sys.argv)
for i in range(1,N):
value = None
if sys.argv[i].startswith('--'):
key = sys.argv[i][2:] #.replace('-','')
2020-09-26 20:32:06 +00:00
2020-08-21 04:49:13 +00:00
SYS_ARGS[key] = 1
2020-09-26 20:32:06 +00:00
2019-11-06 20:37:26 +00:00
if i + 1 < N:
value = sys.argv[i + 1] = sys.argv[i+1].strip()
2020-09-26 20:32:06 +00:00
if key and value and not value.startswith('--'):
2019-11-06 20:37:26 +00:00
SYS_ARGS[key] = value
i += 2