You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A rather common use case for me is to validate the existence of files passed to my program via commandline arguments. CLI11 features Opt::check(CLI::ExistingFile) but It seems to not get called if the option was not present on the command line but there is still a default, e.g.
std::filesystem::path file{"myfile"};
CLI::Option* opt1 = app.add_option("--inifile", file, "Path to your inifile");
I saw the workaround in #115 so consider this just as a though for improvement.
The text was updated successfully, but these errors were encountered:
So with #325 the value of the option specified as a default_str is run through the validators, which is wasn't previously. It still isn't going to check the value just stored in a variable that might get assigned.
A rather common use case for me is to validate the existence of files passed to my program via commandline arguments. CLI11 features
Opt::check(CLI::ExistingFile)
but It seems to not get called if the option was not present on the command line but there is still a default, e.g.I saw the workaround in #115 so consider this just as a though for improvement.
The text was updated successfully, but these errors were encountered: