Closed
Description
What is the right way to get the path to the config file that was parsed? For debugging purposes, I want to log the path to the config file that was loaded. Since the default path could have been overridden during argument parsing, I need the Option returned by the app->get_config_ptr()
call to tell me. At least this is how I have done it:
CLI::Option* config = app.get_config_ptr();
std::vector<std::string> results = config->results();
std::string config_file = config->get_defaultval();
if (results.size() > 0)
{
config_file = results[0];
}
Is there a better way? If not, should there be a better way? If this is not obvious, should this be added to the documentation?
Metadata
Metadata
Assignees
Labels
No labels