Open ismael-elatifi opened 6 years ago
This is likely the same issue as https://github.com/bw2/ConfigArgParse/issues/96
Since you're using the default config file format (rather than .yaml), the current way to specify multiple values is
a=[1,2]
(see REAMDE: https://github.com/bw2/ConfigArgParse#config-file-syntax)
It would be nice to also support the syntax you're using above. If anyone wants to submit a PR for this, I would certainly add it.
btw, would it be possible to support the following syntax given at the command line:
--a [1,2]
which seems to me one of the most intuitive
Consider : parser.add_argument('--a', action='append')
Following args in command line : --a 1 --a 2 Would correctly give after parsing : Namespace(a=['1','2'])
But the same args in a config file : --a 1 --a 2 Would wrongly give after parsing : Namespace(a='2')
In short, parsing multiple times the same arg (with action='append') from a config file is not appending values as it should (like from command line) but instead keeping only the last value.