clap/tests/fixtures/app_regex.yaml
Benjamin Kästner 8cb9a7d486 Add new "regex" feature
This commit introduces a new feature called `"regex"`. It adds a new
function `validator_regex` to `Arg` and was inspired by the discussion
in #1968. The name `validator_regex` was chosen instead of
`regex_validator` to make sure that the developer keeps in mind that
there may only be a single `Validator` on an `Arg`.

The feature can be used with YAML files, however there is no proper
pattern in `clap_app!` (yet).
2020-08-26 17:54:54 +02:00

15 lines
416 B
YAML

name: clapregextest
version: "1.0"
about: tests clap regex functionality
author: Benjamin Kästner <benjamin.kaestner@gmail.com>
settings:
- ArgRequiredElseHelp
args:
- help:
short: h
long: help
about: prints help with a nonstandard description
- filter:
index: 1
validator_regex: ["^*\\.[a-z]+$", expected extension pattern]
about: file extension pattern