Open vipcxj opened 4 months ago
The implicit value syntax is a bit odd because you are giving it a string that is parsed rather than an actual value of the type that you want. I wonder if that should be changed. It might be that a short option with an argument attached doesn't work when it has an implicit value.
For your second example where it just ignores the argument, it thinks that general,cfgo
is a positional parameter. This is an ambiguity problem that has been brought up a few times. The problem is that since no argument is required, there is no good way to determine if the next string is an argument to your option or a positional argument.
For your second example where it just ignores the argument, it thinks that
general,cfgo
is a positional parameter. This is an ambiguity problem that has been brought up a few times. The problem is that since no argument is required, there is no good way to determine if the next string is an argument to your option or a positional argument.
I know there should not be any space between -h and general,cfgo
. Because -hgeneral,cfgo
not work, I try the wrong one. At least the wrong one does not crash.
main --help=general,cfgo
print:main -hgeneral,cfgo
print:main -h general,cfgo
printcxxopts think no argument is put to h opt. so goup is implicit_value {""}
By the way, how to make implicit_value of std::vector as empty vector? "" means a vector with one empty string element, it's too strange.