pub type DefaultCompoundCommandKind = CompoundCommandKind<String, TopLevelWord<String>, TopLevelCommand<String>>;
Expand description
Type alias for the default CompoundCommandKind
representation.
Aliased Type§
pub enum DefaultCompoundCommandKind {
Brace(Vec<TopLevelCommand<String>>),
Subshell(Vec<TopLevelCommand<String>>),
While(GuardBodyPair<TopLevelCommand<String>>),
Until(GuardBodyPair<TopLevelCommand<String>>),
If {
conditionals: Vec<GuardBodyPair<TopLevelCommand<String>>>,
else_branch: Option<Vec<TopLevelCommand<String>>>,
},
For {
var: String,
words: Option<Vec<TopLevelWord<String>>>,
body: Vec<TopLevelCommand<String>>,
},
Case {
word: TopLevelWord<String>,
arms: Vec<PatternBodyPair<TopLevelWord<String>, TopLevelCommand<String>>>,
},
}
Variants§
Brace(Vec<TopLevelCommand<String>>)
A group of commands that should be executed in the current environment.
Subshell(Vec<TopLevelCommand<String>>)
A group of commands that should be executed in a subshell environment.
While(GuardBodyPair<TopLevelCommand<String>>)
A command that executes its body as long as its guard exits successfully.
Until(GuardBodyPair<TopLevelCommand<String>>)
A command that executes its body as until as its guard exits unsuccessfully.
If
A conditional command that runs the respective command branch when a certain of the first condition that exits successfully.
Fields
conditionals: Vec<GuardBodyPair<TopLevelCommand<String>>>
A list of conditional branch-body pairs.
else_branch: Option<Vec<TopLevelCommand<String>>>
An else part to run if no other conditional was taken.
For
A command that binds a variable to a number of provided words and runs its body once for each binding.
Fields
words: Option<Vec<TopLevelWord<String>>>
The words to bind to the specified variable one by one.
body: Vec<TopLevelCommand<String>>
The body to run with the variable binding.
Case
A command that behaves much like a match
statment in Rust, running
a branch of commands if a specified word matches another literal or
glob pattern.
Fields
word: TopLevelWord<String>
The word on which to check for pattern matches.
arms: Vec<PatternBodyPair<TopLevelWord<String>, TopLevelCommand<String>>>
The arms to match against.