bw2 / ConfigArgParse

A drop-in replacement for argparse that allows options to also be set via config files and/or environment variables.
MIT License
721 stars 121 forks source link

write config file ignores "store actions" #209

Open alon-dotan-starkware opened 3 years ago

alon-dotan-starkware commented 3 years ago

example:

from configargparse import ArgumentParser

if __name__ == '__main__':
    base_parser = ArgumentParser(
        add_config_file_help=True,
        description='test',
        args_for_writing_out_config_file=['--generate_config_file'],
        args_for_setting_config_path=['--config_file'])
    base_parser.add_argument('--genome_7', default='bla', help='path to genome file')
    base_parser.add_argument('--genome_1', action='store_true')
    args = base_parser.parse_args()
python tester.py --generate_config_file /tmp/config.ini
cat /tmp/config.ini
genome_7 = bla
bw2 commented 3 years ago

That's a bug. A PR to fix this would be appreciated.