#[non_exhaustive]pub enum Arg {
Positional(Expr),
Named {
key: String,
value: Expr,
},
WordAssign {
key: String,
value: Expr,
},
ShortFlag(String),
LongFlag(String),
DoubleDash,
}Expand description
A command argument (positional or named).
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Positional(Expr)
Positional argument: value
Named
Long flag with attached value: --key=value. Routes through
tool_args.named regardless of the receiving command — except past
--, where it is an operand and the binders stringify it into one
positional "--key=value", the same collapse WordAssign gets there.
WordAssign
Bareword shell-assignment in argv position: key=value.
Only commands on the kernel’s shell-assignment allowlist (export,
alias) consume this as a named arg; for every other command it’s
stringified to a positional "key=value". This matches bash:
cat foo=bar opens a file named foo=bar, not a magical key=value.
ShortFlag(String)
Short flag: -l, -v (boolean flag)
LongFlag(String)
Long flag: --force, --verbose (boolean flag)
DoubleDash
Double-dash marker: -- - signals end of flags
Trait Implementations§
impl StructuralPartialEq for Arg
Auto Trait Implementations§
impl Freeze for Arg
impl RefUnwindSafe for Arg
impl Send for Arg
impl Sync for Arg
impl Unpin for Arg
impl UnsafeUnpin for Arg
impl UnwindSafe for Arg
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,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
Source§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
impl<T> OrderedSeq<'_, T> for Twhere
T: Clone,
Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<'p, T> Seq<'p, T> for Twhere
T: Clone,
impl<'p, T> Seq<'p, T> for Twhere
T: Clone,
Source§impl<T, S> SpanWrap<S> for Twhere
S: WrappingSpan<T>,
impl<T, S> SpanWrap<S> for Twhere
S: WrappingSpan<T>,
Source§fn with_span(self, span: S) -> <S as WrappingSpan<Self>>::Spanned
fn with_span(self, span: S) -> <S as WrappingSpan<Self>>::Spanned
WrappingSpan::make_wrapped to wrap an AST node in a span.