pub enum GlobalFlagSpec {
Bare {
flag: String,
},
TakesValue {
flag: String,
},
}Expand description
Describes how a single global flag (one that appears between the tool name and the subcommand chain) should be consumed during extraction.
Global flags in subcommand-oriented tools precede the subcommand: for
git -C /tmp stash list, -C /tmp are global flags consumed before
stash list. This spec tells the extractor how many tokens to consume.
Variants§
Bare
A bare flag that takes no following value.
E.g. --bare, -p, --paginate, --no-pager.
TakesValue
A flag that carries a value either via = (attached: --git-dir=/tmp)
or a separate next token (--git-dir /tmp, -C /tmp).
The extractor consumes one extra token when there is no =.
Implementations§
Trait Implementations§
Source§impl Clone for GlobalFlagSpec
impl Clone for GlobalFlagSpec
Source§fn clone(&self) -> GlobalFlagSpec
fn clone(&self) -> GlobalFlagSpec
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for GlobalFlagSpec
impl Debug for GlobalFlagSpec
Source§impl<'de> Deserialize<'de> for GlobalFlagSpec
impl<'de> Deserialize<'de> for GlobalFlagSpec
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 Eq for GlobalFlagSpec
Source§impl PartialEq for GlobalFlagSpec
impl PartialEq for GlobalFlagSpec
Source§impl Serialize for GlobalFlagSpec
impl Serialize for GlobalFlagSpec
impl StructuralPartialEq for GlobalFlagSpec
Auto Trait Implementations§
impl Freeze for GlobalFlagSpec
impl RefUnwindSafe for GlobalFlagSpec
impl Send for GlobalFlagSpec
impl Sync for GlobalFlagSpec
impl Unpin for GlobalFlagSpec
impl UnsafeUnpin for GlobalFlagSpec
impl UnwindSafe for GlobalFlagSpec
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