clap/tests/fixtures/app.yaml
Marti Raudsepp 64ee0f8009 Add hinting of arg value types for zsh/fish completion
Adds new method/attribute `Arg::value_hint`, taking a `ValueHint` enum
as argument. The hint can denote accepted values, for example: paths,
usernames, hostnames, commands, etc.

This initial implementation supports hints for the zsh and fish
completion generators, support for other shells can be added later.
2020-08-06 22:17:31 +03:00

143 lines
3.6 KiB
YAML

name: claptests
version: "1.0"
about: tests clap library
author: Kevin K. <kbknapp@gmail.com>
settings:
- ArgRequiredElseHelp
args:
- help:
short: h
long: help
about: prints help with a nonstandard description
- option:
short: o
long: option
multiple: true
about: tests options
- positional:
about: tests positionals
index: 1
- positional2:
about: tests positionals with exclusions
index: 2
default_value_if:
- [flag, Null, some]
- [positional, other, something]
- flag:
short: f
long: flag
multiple: true
about: tests flags
global: true
- flag2:
short: F
about: tests flags with exclusions
conflicts_with:
- flag
requires:
- option2
- option2:
long: long-option-2
about: tests long options with exclusions
conflicts_with:
- option
requires:
- positional2
- option3:
short: O
long: Option
about: tests options with specific value sets
takes_value: true
possible_values:
- fast
- slow
requires_if:
- [fast, flag]
- positional3:
index: 3
about: tests positionals with specific values
possible_values: [ vi, emacs ]
- multvals:
long: multvals
about: Tests multiple values, not mult occs
value_names:
- one
- two
- multvalsmo:
long: multvalsmo
multiple: true
about: Tests multiple values, not mult occs
value_names: [one, two]
- multvalsdelim:
long: multvalsdelim
about: Tests multiple values with required delimiter
multiple: true
require_delimiter: true
- singlealias:
long: singlealias
about: Tests single alias
aliases: [alias]
required_if:
- [multvalsmo, two]
- multaliases:
long: multaliases
about: Tests multiple aliases
aliases: [als1, als2, als3]
- singleshortalias:
long: singleshortalias
about: Tests single short alias
short_aliases: [a]
required_if:
- [multvalsmo, two]
- multshortaliases:
long: multshortaliases
about: Tests multiple short aliases
short_aliases: [a, b, c]
- minvals2:
long: minvals2
multiple: true
about: Tests 2 min vals
min_values: 2
- maxvals3:
long: maxvals3
multiple: true
about: Tests 3 max vals
max_values: 3
- exclusive:
long: exclusive
about: Tests 3 exclusive
exclusive: true
- case_insensitive:
index: 4
help: Test case_insensitive
possible_values: [test123, test321]
case_insensitive: true
- value_hint:
long: value-hint
help: Test value_hint
value_hint: FilePath
arg_groups:
- test:
args:
- maxvals3
- minmals2
conflicts_with:
- option3
requires:
- multvals
subcommands:
- subcmd:
about: tests subcommands
version: "0.1"
author: Kevin K. <kbknapp@gmail.com>
args:
- scoption:
short: o
long: option
multiple: true
about: tests options
takes_value: true
- scpositional:
about: tests positionals
index: 1