[][src]Trait clapme::ClapMe

pub trait ClapMe: Sized {
    fn with_clap<T>(_info: ArgInfo, app: App, f: impl FnOnce(App) -> T) -> T { ... }
fn from_clap(_name: &str, _app: &ArgMatches) -> Option<Self> { ... }
fn requires_flags(name: &str) -> Vec<String> { ... }
fn help_message(cmdname: &str) -> String { ... }
fn from_args() -> Self { ... }
fn from_iter<I, T>(args: I) -> Result<Self, Error>
    where
        I: IntoIterator<Item = T>,
        T: Into<OsString> + Clone
, { ... } }

Any type of trait ClapMe can be used as an argument value.

Provided methods

fn with_clap<T>(_info: ArgInfo, app: App, f: impl FnOnce(App) -> T) -> T

Updates and returns the corresponding clap::App.

fn from_clap(_name: &str, _app: &ArgMatches) -> Option<Self>

Parses the clap info to obtain a value. None is returned if the argument was not required, and was also not provided.

fn requires_flags(name: &str) -> Vec<String>

Parses the clap info to obtain a value. None is returned if the argument was not required, and was also not provided.

fn help_message(cmdname: &str) -> String

The help message for this struct. This is most useful for test cases.

fn from_args() -> Self

Parse command line arguments.

fn from_iter<I, T>(args: I) -> Result<Self, Error> where
    I: IntoIterator<Item = T>,
    T: Into<OsString> + Clone

Parse arguments given through an iterable thing such as a Vec or a slice.

Loading content...

Implementations on Foreign Types

impl ClapMe for bool[src]

impl ClapMe for f32[src]

impl ClapMe for Vec<f32>[src]

impl ClapMe for f64[src]

impl ClapMe for Vec<f64>[src]

impl ClapMe for IpAddr[src]

impl ClapMe for Vec<IpAddr>[src]

impl ClapMe for Ipv4Addr[src]

impl ClapMe for Vec<Ipv4Addr>[src]

impl ClapMe for Ipv6Addr[src]

impl ClapMe for Vec<Ipv6Addr>[src]

impl ClapMe for SocketAddr[src]

impl ClapMe for Vec<SocketAddr>[src]

impl ClapMe for SocketAddrV4[src]

impl ClapMe for Vec<SocketAddrV4>[src]

impl ClapMe for SocketAddrV6[src]

impl ClapMe for Vec<SocketAddrV6>[src]

impl ClapMe for i16[src]

impl ClapMe for Vec<i16>[src]

impl ClapMe for isize[src]

impl ClapMe for Vec<isize>[src]

impl ClapMe for i32[src]

impl ClapMe for Vec<i32>[src]

impl ClapMe for i64[src]

impl ClapMe for Vec<i64>[src]

impl ClapMe for i128[src]

impl ClapMe for Vec<i128>[src]

impl ClapMe for u16[src]

impl ClapMe for Vec<u16>[src]

impl ClapMe for u32[src]

impl ClapMe for Vec<u32>[src]

impl ClapMe for u64[src]

impl ClapMe for Vec<u64>[src]

impl ClapMe for u128[src]

impl ClapMe for Vec<u128>[src]

impl ClapMe for usize[src]

impl ClapMe for Vec<usize>[src]

impl ClapMe for String[src]

impl ClapMe for Vec<String>[src]

impl ClapMe for PathBuf[src]

impl ClapMe for Vec<PathBuf>[src]

impl ClapMe for OsString[src]

impl ClapMe for Vec<OsString>[src]

impl<T: ClapMe> ClapMe for Option<T>[src]

impl<T> ClapMe for PhantomData<T>[src]

Loading content...

Implementors

Loading content...