mirror of
https://github.com/clap-rs/clap
synced 2025-03-05 07:47:40 +00:00
parent
5bf0d2ffb5
commit
3186513b57
1 changed files with 7 additions and 7 deletions
|
@ -53,13 +53,13 @@
|
|||
//!
|
||||
//! The type of the field gives the kind of argument:
|
||||
//!
|
||||
//! Type | Effect | Added method call to `clap::Arg`
|
||||
//! ---------------------|--------------------------------------|--------------------------------------
|
||||
//! `bool` | `true` if present | `.takes_value(false).multiple(false)`
|
||||
//! `u64` | number of times the argument is used | `.takes_value(false).multiple(true)`
|
||||
//! `Option<T: FromStr>` | optional argument | `.takes_value(true).multiple(false)`
|
||||
//! `Vec<T: FromStr>` | list of arguments | `.takes_value(true).multiple(true)`
|
||||
//! `T: FromStr` | required argument | `.takes_value(true).multiple(false).required(!has_default)`
|
||||
//! Type | Effect | Added method call to `clap::Arg`
|
||||
//! ---------------------|---------------------------------------------------|--------------------------------------
|
||||
//! `bool` | `true` if the flag is present | `.takes_value(false).multiple(false)`
|
||||
//! `u64` | number of times the flag is used | `.takes_value(false).multiple(true)`
|
||||
//! `Option<T: FromStr>` | optional positional argument or option | `.takes_value(true).multiple(false)`
|
||||
//! `Vec<T: FromStr>` | list of options or the other positional arguments | `.takes_value(true).multiple(true)`
|
||||
//! `T: FromStr` | required option or positional argument | `.takes_value(true).multiple(false).required(!has_default)`
|
||||
//!
|
||||
//! The `FromStr` trait is used to convert the argument to the given
|
||||
//! type, and the `Arg::validator` method is set to a method using
|
||||
|
|
Loading…
Add table
Reference in a new issue