mirror of
https://github.com/timvisee/ffsend.git
synced 2025-10-03 09:39:15 +02:00
31 lines
684 B
Rust
31 lines
684 B
Rust
use clap::{Arg, ArgMatches};
|
|
|
|
use super::{CmdArg, CmdArgOption};
|
|
|
|
/// The owner argument.
|
|
pub struct ArgOwner { }
|
|
|
|
impl CmdArg for ArgOwner {
|
|
fn name() -> &'static str {
|
|
"owner"
|
|
}
|
|
|
|
fn build<'b, 'c>() -> Arg<'b, 'c> {
|
|
Arg::with_name("owner")
|
|
.long("owner")
|
|
.short("o")
|
|
.alias("own")
|
|
.alias("owner-token")
|
|
.alias("token")
|
|
.value_name("TOKEN")
|
|
.help("Specify the file owner token")
|
|
}
|
|
}
|
|
|
|
impl<'a> CmdArgOption<'a> for ArgOwner {
|
|
type Value = Option<&'a str>;
|
|
|
|
fn value<'b: 'a>(matches: &'a ArgMatches<'b>) -> Self::Value {
|
|
Self::value_raw(matches)
|
|
}
|
|
}
|