ConfigArgParse icon indicating copy to clipboard operation
ConfigArgParse copied to clipboard

Write config file argument with default value fails

Open othalan opened this issue 5 years ago • 0 comments

Using the flag is_write-out_config_file_arg with a default value does not permit use of the default argument.

Code:

import configargparse
parser = configargparse.get_parser()

parser = cls.get_parser()

parser.add('--test-arg',
                action = 'store',
                help    = "Write this command line to a configuration file")
parser.add('--config-write',
                is_write_out_config_file_arg = True,
                default                      = str('~/.test_config.ini'),
                help                         = "Write this command line to a configuration file")

Command Line:

./my_app --test-arg testArgValue --config-write

The above command results in an error, saying that --config-write requires a value even though a default is provided and shows on the help display.

othalan avatar May 21 '19 07:05 othalan