mirror of
https://github.com/clap-rs/clap
synced 2024-11-10 06:44:16 +00:00
commit
708c00bd5f
3 changed files with 6 additions and 9 deletions
|
@ -207,8 +207,8 @@ impl Parse for ClapAttr {
|
|||
}
|
||||
"default_value_t" => Ok(DefaultValueT(name, None)),
|
||||
"default_value_os_t" => Ok(DefaultValueOsT(name, None)),
|
||||
"about" => (Ok(About(name))),
|
||||
"author" => (Ok(Author(name))),
|
||||
"about" => Ok(About(name)),
|
||||
"author" => Ok(Author(name)),
|
||||
"version" => Ok(Version(name)),
|
||||
|
||||
"skip" => Ok(Skip(name, None)),
|
||||
|
|
|
@ -5324,7 +5324,7 @@ impl Default for ArgProvider {
|
|||
}
|
||||
}
|
||||
|
||||
/// Write the values such as <name1> <name2>
|
||||
/// Write the values such as `<name1> <name2>`
|
||||
pub(crate) fn display_arg_val<F, T, E>(arg: &Arg, mut write: F) -> Result<(), E>
|
||||
where
|
||||
F: FnMut(&str, bool) -> Result<T, E>,
|
||||
|
|
|
@ -2104,10 +2104,8 @@ pub mod via_prelude {
|
|||
/// assert_eq!(format!("{:?}", parser), "ValueParser::os_string");
|
||||
/// let parser = clap::value_parser!(std::path::PathBuf);
|
||||
/// assert_eq!(format!("{:?}", parser), "ValueParser::path_buf");
|
||||
/// let parser = clap::value_parser!(u16).range(3000..);
|
||||
/// assert_eq!(format!("{:?}", parser), "RangedI64ValueParser { bounds: (Included(3000), Included(65535)), target: PhantomData }");
|
||||
/// let parser = clap::value_parser!(u64).range(3000..);
|
||||
/// assert_eq!(format!("{:?}", parser), "RangedU64ValueParser { bounds: (Included(3000), Unbounded), target: PhantomData }");
|
||||
/// let _parser = clap::value_parser!(u16).range(3000..);
|
||||
/// let _parser = clap::value_parser!(u64).range(3000..);
|
||||
///
|
||||
/// // FromStr types
|
||||
/// let parser = clap::value_parser!(usize);
|
||||
|
@ -2133,8 +2131,7 @@ pub mod via_prelude {
|
|||
/// # }
|
||||
/// # }
|
||||
/// }
|
||||
/// let parser = clap::value_parser!(ColorChoice);
|
||||
/// assert_eq!(format!("{:?}", parser), "EnumValueParser(PhantomData)");
|
||||
/// let _parser = clap::value_parser!(ColorChoice);
|
||||
/// ```
|
||||
#[macro_export]
|
||||
macro_rules! value_parser {
|
||||
|
|
Loading…
Reference in a new issue