mirror of
https://github.com/clap-rs/clap
synced 2024-12-12 13:52:34 +00:00
647896d929
This is the derive support for #3774 (see also #3775, #3777) This combined with `value_parser` replaces `parser`. The main frustration with this is that `ArgAction::Count` (the replacement for `parse(from_occurrences)` must be a `u64`. We could come up with a magic attribute that is meant to be the value parser's parsed type. We could then use `TryFrom` to convert the parsed type to the user's type to allow more. That is an exercise for the future. Alternatively, we have #3792. Prep for this included - #3782 - #3783 - #3786 - #3789 - #3793 |
||
---|---|---|
.. | ||
derive_ref | ||
tutorial_builder | ||
tutorial_derive | ||
cargo-example-derive.md | ||
cargo-example-derive.rs | ||
cargo-example.md | ||
cargo-example.rs | ||
demo.md | ||
demo.rs | ||
escaped-positional-derive.md | ||
escaped-positional-derive.rs | ||
escaped-positional.md | ||
escaped-positional.rs | ||
git-derive.md | ||
git-derive.rs | ||
git.md | ||
git.rs | ||
multicall-busybox.md | ||
multicall-busybox.rs | ||
multicall-hostname.md | ||
multicall-hostname.rs | ||
pacman.md | ||
pacman.rs | ||
README.md | ||
repl.rs | ||
typed-derive.md | ||
typed-derive.rs |
Examples
- Basic demo: derive
- Typed arguments: derive
- Topics:
- Custom
parse()
- Custom
- Topics:
- Custom cargo command: builder, derive
- Topics:
- Subcommands
- Cargo plugins
- Topics:
- git-like interface: builder, derive
- Topics:
- Subcommands
- External subcommands
- Optional subcommands
- Default subcommands
- Topics:
- pacman-like interface: builder
- Topics:
- Flag subcommands
- Conflicting arguments
- Topics:
- Escaped positionals with
--
: builder, derive - Multi-call
- repl: builder
- Topics:
- Read-Eval-Print Loops / Custom command lines
- Topics:
Contributing
New examples:
- Building: They must be added to Cargo.toml with the appropriate
required-features
. - Testing: Ensure there is a markdown file with trycmd syntax
- Link the
.md
file from here
See also the general CONTRIBUTING.