bw2 / ConfigArgParse

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

Support parser to sys.argv conversion #292

Open skakunm opened 4 months ago

skakunm commented 4 months ago

Arge part of the code is relying on Argparse logic, including expecting it to read some things from sys.argv. And now I read arguments from config file in the main script, thus don't get the same sys.argv values. Is it possible to add a single function that would output equivalent sys.argv value for the current parser values? I see "convert_item_to_command_line_arg" function but it's not really clear how to use it, and it would be nice to have one function similar to ArgumentParser.convert_arg_line_to_args just inverted.