CLI library and reading the parameters from a config file

Hey everyone,

I was wondering whether or not the llvm::cl library supports reading the value of defined parameters from a config file. For example, let’s say we have defined --format and --host for a program using the cli library. Is it possible to pass the path to a config file like config.yml or anything similar to that with:

format: blah
host: blah

to the program and cli library populate the parameters for us?

If this feature is not supported, what do you thing about this feature and do you like this to be added as well?

cl::readConfigFile (link. You can checkout unittests/Support/CommandLineTest.cpp for a sample usage) might be the closest thing you’re looking for. Although it’s not reading from a YAML file.

1 Like

That’s perfect, thank you