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§
Positional(Expr)
Positional argument: value
Named
Long flag with attached value: --key=value. Always routes through
tool_args.named regardless of the receiving command.
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
Mutably borrows from an owned value. Read more