pub mod api;
pub mod basic_auth;
pub mod download_limit;
pub mod expiry_time;
pub mod gen_passphrase;
pub mod host;
pub mod owner;
pub mod password;
pub mod url;
pub use self::api::ArgApi;
pub use self::basic_auth::ArgBasicAuth;
pub use self::download_limit::ArgDownloadLimit;
pub use self::expiry_time::ArgExpiryTime;
pub use self::gen_passphrase::ArgGenPassphrase;
pub use self::host::ArgHost;
pub use self::owner::ArgOwner;
pub use self::password::ArgPassword;
pub use self::url::ArgUrl;
use clap::{Arg, ArgMatches};
pub trait CmdArg {
fn name() -> &'static str;
fn build<'a, 'b>() -> Arg<'a, 'b>;
}
pub trait CmdArgFlag: CmdArg {
fn is_present<'a>(matches: &ArgMatches<'a>) -> bool {
matches.is_present(Self::name())
}
}
pub trait CmdArgOption<'a>: CmdArg {
type Value;
fn value<'b: 'a>(matches: &'a ArgMatches<'b>) -> Self::Value;
fn value_raw<'b: 'a>(matches: &'a ArgMatches<'b>) -> Option<&'a str> {
matches.value_of(Self::name())
}
}