-
Using CLI11 when i call a transform mutating validator followed by a call to the check validator, check never gets called. If a non mutating transform is called before check, everything is fine and check is called. for example the bad case: grp->add_option_functionstd::string( // where MutatingValidator is defined as follows: struct MutatingValidator : public Validator { I also posted on stackoverflow: |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
For a validator the return string is an error message. Any changes to the string should be modified in place. So since your function returns a string it will be interpreted as an error and cease processing at that point. so the check would never get called. The signature of the function call for a mutation validator is |
Beta Was this translation helpful? Give feedback.
For a validator the return string is an error message. Any changes to the string should be modified in place.
So since your function returns a string it will be interpreted as an error and cease processing at that point. so the check would never get called.
The signature of the function call for a mutation validator is
std::string(std::string &)
The input is the argument to process (passed by reference so it can be modified) the output is an error string if any.