Open astariul opened 5 years ago
I end up using a dirty work-around :
import lib
import configargparse
parser = lib.get_parser()
p = configargparse.ArgParser()
parser.__class__ = configargparse.ArgParser
for attribute in dir(p):
if attribute not in dir(parser):
setattr(parser, attribute, getattr(p, attribute))
parser.add("--config", is_config_file=True, help="Configuration file path.")
args = parser.parse_args()
As you see, it's dirty but it works.
I'm looking for a cleaner way to achieve this.
I'm using an external library, which use ArgParse.
I would like to use ConfigParse, in order to give a config file to ArgParse.
Something like :