ConfigArgParse icon indicating copy to clipboard operation
ConfigArgParse copied to clipboard

Support parser to sys.argv conversion

Open skakunm opened this issue 1 year ago • 1 comments

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.

skakunm avatar Apr 18 '24 08:04 skakunm

This is an easy fix since ConfigArgParse does generate the command line internally. If it just remembered the last command line passed to argparse.parse_known_args then the caller could obtain this without having to try manually calling the conversion functions.

I added this into my development fork.

tbooth avatar Apr 23 '25 10:04 tbooth