pub enum Command {
Simple(Vec<Assignment>, Vec<Word>, Vec<Redirect>),
Compound(Vec<Command>),
Not(Box<Command>),
And(Box<Command>, Box<Command>),
Or(Box<Command>, Box<Command>),
Subshell(Box<Program>),
Pipeline(Box<Command>, Box<Command>),
Background(Box<Command>),
Lang(Interpreter, String),
}
Expand description
A command is a highly mutually-recursive node with the main features of the POSIX language.
Variants§
Simple(Vec<Assignment>, Vec<Word>, Vec<Redirect>)
Compound(Vec<Command>)
A full program embedded in a compound command.
{ ls ; }
Not(Box<Command>)
Performs boolean negation to the status code of the inner command.
Examples
! grep 'password' data.txt
And(Box<Command>, Box<Command>)
Or(Box<Command>, Box<Command>)
Perform the first command, conditionally running the next upon failure.
Examples
kill $1 || kill -9 $1
Subshell(Box<Program>)
Pipeline(Box<Command>, Box<Command>)
Background(Box<Command>)
Lang(Interpreter, String)
Run a program through another parser/interpreter.
Examples
{#ruby puts (Math.sqrt(32**2/57.2))}
Compatibility
This is non-POSIX
TODO: How bad is it?
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for Command
impl Send for Command
impl Sync for Command
impl Unpin for Command
impl UnwindSafe for Command
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