[Suggestion] Checking whether some opt keys exist & Specifying default values
One possible syntax would be:
bool has_n = has_opt<int>("n"); // true if integer n is specified as key, false otherwise
int n = opt<int>("n", 100); // if integer n is not specified as key, returns default value 100
Also, it would be nice if bool type keys defaults to false, unless otherwise specified. It would suit -prop / --prop syntax better.
Currently, there is no way to implement such feature in user code without directly accessing __testlib_opts variable.
I meet the same issue. Make the bool type key false is very common in use. But now we can only use --key=false to solve it.
I implemented all except int n = opt
A bit late, but #136 implements this feature. Great!