I am trying to implement below option by using argparse(can't use any other tool like docopt because of project requirement):-
cli.py --conf key1=value1, key2=value2, kay3=value3
or
cli.py --conf key1=value1 key2=value2 key3=value3
So far I have tried type=json.loads
or dict but not helping.
One possible solution is to use type=str
and then later parse it to dict
.
Do you guys know any other better solution which I am missing..
Thanks in advance.
Note- Can't use --key1=value1 --key2=value2 --key3=value3 because I don't want to restrict count and name of key/value. It will help in supporting new key/val in future.