Open ihadanny opened 5 years ago
my config.ini:
banana=original_banana
if I run with full argument name, I get the expected result:
python test_configargparse.py --banana new_banana new_banana
if I run with abbreviated argument name (--ban instead of --banana), I get unexpected behaviour:
--ban
--banana
python test_configargparse.py --ban new_banana original_banana
code for test_configargparse.py
import os, configargparse as ap parser = ap.ArgumentParser(default_config_files=["config.ini"]) parser.add_argument('--banana',dest='banana') options = parser.parse_args() print(options.banana)
versions = ConfigArgParse==0.13.0, Python 2.7.10
ConfigArgParse==0.13.0
Python 2.7.10
is this a bug or am I missing something obvious?? it's a very basic feature in a very established module...
NOTE: this feature is explicitly documented in https://docs.python.org/3/library/argparse.html
allows long options to be abbreviated to a prefix, if the abbreviation is unambiguous (the prefix matches a unique option)
see also https://stackoverflow.com/questions/53848275/configargparse-ignores-abbreviated-options
This seems like a bug. If impossible to fix, the difference with argparse behavior should be documented I guess.
This is linked to my issue: https://github.com/bw2/ConfigArgParse/issues/217
my config.ini:
if I run with full argument name, I get the expected result:
if I run with abbreviated argument name (
--ban
instead of--banana
), I get unexpected behaviour:code for test_configargparse.py
versions =
ConfigArgParse==0.13.0
,Python 2.7.10
is this a bug or am I missing something obvious?? it's a very basic feature in a very established module...
NOTE: this feature is explicitly documented in https://docs.python.org/3/library/argparse.html
see also https://stackoverflow.com/questions/53848275/configargparse-ignores-abbreviated-options