jimingham wrote:

This version is still a little awkward because there's an ambiguity about what 
the incoming string being empty means.  In the VerifyCommandOptionValue, it 
means "No Value" and the return is not distinguishable from "error" - but in a 
bunch of the places where you use VerifyCommandOptionValue an empty string just 
means a value wasn't provided,  so you end up with constructs where you set the 
optional (checking the incoming string for `empty`) then check the input string 
again so you can tell empty apart from error, THEN make up the error on the 
outside w/o knowing what actually was wrong with the string.

I wonder if it would be better to add a Status to the call.  Then empty input 
-> "Empty Optional but no error"; error in parsing -> "Empty Optional but 
error" and result means success.  Then you wouldn't have to do two checks on 
the input string in different places, or make up the error string.

https://github.com/llvm/llvm-project/pull/79901
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to