Open mathisloevenich opened 3 years ago
This is a bug. The problem is at least partly due to https://github.com/bw2/ConfigArgParse/blob/master/configargparse.py#L1032
checking for exact matches without first converting prefixes to their corresponding full option names. A PR to fix this would be appreciated.
Replacing https://github.com/bw2/ConfigArgParse/blob/d8eb8731dfe32125b83d14b9332990af0eb072cc/configargparse.py#L1058-L1060 with
return any(
arg_name.startswith(potential_arg) for potential_arg in potential_command_line_args for arg_name in arg_names
)
should fix this, but argparse has since added an allow_abbrev
arg, so will need to add handling for that before this can be fixed.
In my scenrio I have values being set in the config file like:
ignore = [errors]
Starting my script with:
htcanalyze --ignore recources
will override the internal list
ignore = [recources]
HOWEVER, when I only use the prefix:
htcanalyze --ign recources
it will result in
ignore = [errors]
.In this case the config values will not be overwritten, which will result in different user experiences cause no error is thrown due to the ability of argparse on matching prefixes.
This is related to the issue of my project: https://github.com/psyinfra/HTCAnalyze/issues/90