pub struct ArgSpec {
pub argument_id: String,
pub syntax: ArgSyntax,
pub value_type: ArgValueType,
pub value_name: Option<String>,
pub enum_values: Vec<String>,
pub default: Option<CliValue>,
pub repeatable: bool,
pub sensitive: bool,
pub about: Option<String>,
}Expand description
One command-local application argument.
Fields§
§argument_id: String§syntax: ArgSyntax§value_type: ArgValueType§value_name: Option<String>§enum_values: Vec<String>§default: Option<CliValue>§repeatable: bool§sensitive: boolThis argument’s value must never be echoed back.
The core only consumes the bit: it suppresses help defaults, keeps the
value out of rendered templates, and rejects a serializable default.
Which arguments deserve it is a host convention — crate::cli_afdata
derives it from AFDATA’s _secret suffix.
about: Option<String>Implementations§
Source§impl ArgSpec
impl ArgSpec
pub fn flag(long: impl Into<String>) -> Self
pub fn option(long: impl Into<String>, value_name: impl Into<String>) -> Self
pub fn option_i64( long: impl Into<String>, value_name: impl Into<String>, ) -> Self
pub fn option_f64( long: impl Into<String>, value_name: impl Into<String>, ) -> Self
pub fn option_json( long: impl Into<String>, value_name: impl Into<String>, ) -> Self
pub fn option_enum<I, S>(long: impl Into<String>, values: I) -> Self
pub fn positional( argument_id: impl Into<String>, index: usize, value_name: impl Into<String>, ) -> Self
pub fn positional_json( argument_id: impl Into<String>, index: usize, value_name: impl Into<String>, ) -> Self
pub fn positional_enum<I, S>( argument_id: impl Into<String>, index: usize, value_name: impl Into<String>, values: I, ) -> Self
pub fn value_name(self, value_name: impl Into<String>) -> Self
pub fn default(self, value: impl Into<String>) -> Self
pub fn default_i64(self, value: i64) -> Self
pub fn default_f64(self, value: f64) -> Self
pub fn repeatable(self) -> Self
Sourcepub fn sensitive(self) -> Self
pub fn sensitive(self) -> Self
Mark this argument’s value as one that must never be echoed back.
pub fn about(self, about: impl Into<String>) -> Self
Trait Implementations§
Source§impl<'de> Deserialize<'de> for ArgSpec
impl<'de> Deserialize<'de> for ArgSpec
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl StructuralPartialEq for ArgSpec
Auto Trait Implementations§
impl Freeze for ArgSpec
impl RefUnwindSafe for ArgSpec
impl Send for ArgSpec
impl Sync for ArgSpec
impl Unpin for ArgSpec
impl UnsafeUnpin for ArgSpec
impl UnwindSafe for ArgSpec
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more