Skip to content

Update book chapter on Validators #676

Open
@phlptp

Description

@phlptp

Thanks Philip for the quick response. This worked. i was confused by this statement where it talks about throwing a ValidationError when there is an error vs just returning a non empty string:

https://cliutils.github.io/CLI11/book/chapters/validators.html:
"A transform validator comes in one form, a function with the signature std::string(std::string). The function will take a string and return the modified version of the string. If there is an error, the function should throw a CLI::ValidationError with the appropriate reason as a message."

Originally posted by @dhsu123 in #675 (reply in thread)

Metadata

Metadata

Assignees

No one assigned

    Labels

    docsAdd/update documentation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions