Struct tauri_utils::config::CliArg [−][src]
A CLI argument definition
Fields
short: Option<char>The short version of the argument, without the preceding -.
NOTE: Any leading - characters will be stripped, and only the first non - character will be used as the short version.
name: StringThe unique argument name
description: Option<String>The argument description which will be shown on the help information. Typically, this is a short (one line) description of the arg.
long_description: Option<String>The argument long description which will be shown on the help information. Typically this a more detailed (multi-line) message that describes the argument.
takes_value: Option<bool>Specifies that the argument takes a value at run time.
NOTE: values for arguments may be specified in any of the following methods
- Using a space such as -o value or –option value
- Using an equals and no space such as -o=value or –option=value
- Use a short and no space such as -ovalue
multiple: Option<bool>Specifies that the argument may appear more than once.
- For flags, this results in the number of occurrences of the flag being recorded. For example -ddd or -d -d -d would count as three occurrences.
- For options there is a distinct difference in multiple occurrences vs multiple values. For example, –opt val1 val2 is one occurrence, but two values. Whereas –opt val1 –opt val2 is two occurrences.
multiple_occurrences: Option<bool>number_of_values: Option<u64>possible_values: Option<Vec<String>>Specifies a list of possible values for this argument. At runtime, the CLI verifies that only one of the specified values was used, or fails with an error message.
min_values: Option<u64>Specifies the minimum number of values for this argument.
For example, if you had a -f minValues: 2, and this argument would be satisfied if the user provided, 2 or more values.
max_values: Option<u64>Specifies the maximum number of values are for this argument.
For example, if you had a -f
required: Option<bool>Sets whether or not the argument is required by default.
- Required by default means it is required, when no other conflicting rules have been evaluated
- Conflicting rules take precedence over being required.
required_unless_present: Option<String>Sets an arg that override this arg’s required setting i.e. this arg will be required unless this other argument is present.
required_unless_present_all: Option<Vec<String>>Sets args that override this arg’s required setting i.e. this arg will be required unless all these other arguments are present.
required_unless_present_any: Option<Vec<String>>Sets args that override this arg’s required setting i.e. this arg will be required unless at least one of these other arguments are present.
conflicts_with: Option<String>Sets a conflicting argument by name i.e. when using this argument, the following argument can’t be present and vice versa.
conflicts_with_all: Option<Vec<String>>The same as conflictsWith but allows specifying multiple two-way conflicts per argument.
requires: Option<String>Tets an argument by name that is required when this one is present i.e. when using this argument, the following argument must be present.
requires_all: Option<Vec<String>>Sts multiple arguments by names that are required when this one is present i.e. when using this argument, the following arguments must be present.
requires_if: Option<Vec<String>>Allows a conditional requirement with the signature [arg, value]
the requirement will only become valid if arg’s value equals ${value}.
required_if_eq: Option<Vec<String>>Allows specifying that an argument is required conditionally with the signature [arg, value]
the requirement will only become valid if the arg’s value equals ${value}.
require_equals: Option<bool>Requires that options use the –option=val syntax i.e. an equals between the option and associated value.
index: Option<u64>The positional argument index, starting at 1.
The index refers to position according to other positional argument. It does not define position in the argument list as a whole. When utilized with multiple=true, only the last positional argument may be defined as multiple (i.e. the one with the highest index).
Trait Implementations
impl Clone for CliArg[src]
impl Debug for CliArg[src]
impl Default for CliArg[src]
impl<'de> Deserialize<'de> for CliArg[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>, [src]
__D: Deserializer<'de>,
impl PartialEq<CliArg> for CliArg[src]
impl StructuralPartialEq for CliArg[src]
Auto Trait Implementations
impl RefUnwindSafe for CliArg
impl Send for CliArg
impl Sync for CliArg
impl Unpin for CliArg
impl UnwindSafe for CliArg
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>, [src]
T: for<'de> Deserialize<'de>,
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T> Pointable for T
pub const ALIGN: usize
type Init = T
The type for initializers.
pub unsafe fn init(init: <T as Pointable>::Init) -> usize
pub unsafe fn deref<'a>(ptr: usize) -> &'a T
pub unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T
pub unsafe fn drop(ptr: usize)
impl<T> ToOwned for T where
T: Clone, [src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T[src]
pub fn clone_into(&self, target: &mut T)[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,