pub enum RemoteArgKind {
Flag,
Value {
prompt: &'static str,
},
ValueJoined {
prompt: &'static str,
},
}Expand description
MG.17b: what an argument contributes to the command line.
Variants§
Flag
A toggle: contributes arg when on, nothing when off.
Value
A value: contributes arg followed by the typed text (or just
the text when arg is empty, for a positional like a remote
name). Contributes nothing when unset.
ValueJoined
MG.23k: a value that must be joined to its argument rather than passed as a separate token.
Not a stylistic variant — git rejects the separated form for
some options and accepts it for others. git log --author x
works; git diff -U 3 and git diff --unified 3 are both
errors, because a long option’s value needs = and -U’s
needs gluing on. So the argument carries its own joiner
("--unified=") and the value is appended to it. Verified
against real git rather than assumed — the separated form was
tried first and rejected.
Trait Implementations§
Source§impl Clone for RemoteArgKind
impl Clone for RemoteArgKind
Source§fn clone(&self) -> RemoteArgKind
fn clone(&self) -> RemoteArgKind
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for RemoteArgKind
Source§impl Debug for RemoteArgKind
impl Debug for RemoteArgKind
impl Eq for RemoteArgKind
Source§impl PartialEq for RemoteArgKind
impl PartialEq for RemoteArgKind
impl StructuralPartialEq for RemoteArgKind
Auto Trait Implementations§
impl Freeze for RemoteArgKind
impl RefUnwindSafe for RemoteArgKind
impl Send for RemoteArgKind
impl Sync for RemoteArgKind
impl Unpin for RemoteArgKind
impl UnsafeUnpin for RemoteArgKind
impl UnwindSafe for RemoteArgKind
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more