You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
351 B
Python
19 lines
351 B
Python
5 years ago
|
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('-','')
|
||
|
SYS_ARGS[key] = 1
|
||
|
if i + 1 < N:
|
||
|
value = sys.argv[i + 1] = sys.argv[i+1].strip()
|
||
|
if key and value:
|
||
|
SYS_ARGS[key] = value
|
||
|
|
||
|
|
||
|
i += 2
|