cxxopts
cxxopts copied to clipboard
When a default string is an empty string, it shows without quotes in help
When I define a default argument to an option like this:
("c,config", "a json config, as a string", cxxopts::value<string>()->default_value(""))
it shows in the help like this:
-c, --config arg a json config, as a string (default: )
This is ambiguous because the user won't know if the default is an empty string or if there is no default. It should look like this:
-c, --config arg a json config, as a string (default: "")
try default_value("\"\"");
escaped quotes
@piotrklos-tcl That seems reasonable.
@rathod-sahaab That would set the default value to actually be the string ""
, which is probably not what is needed.
@jarro2783 I get it now 😅
Need to edit one of help()
I am trying to figure out if there is a way to ALWAYS get the default value quoted? Some of my default values are space separated strings, and it would be much clearer if they were always quoted.