pub struct ShellSegment {
pub command: String,
pub redirection: Option<Redirection>,
pub substitutions: Vec<SubstitutionSpan>,
}Expand description
A single evaluable command within a compound pipeline.
Fields§
§command: StringThe command text, exactly as it appears in the source (trimmed).
Substitution syntax ($(), backticks, <(), >()) is preserved
verbatim — the substitutions field carries
the recursively-parsed contents with byte positions into this text.
redirection: Option<Redirection>Output redirection detected on a wrapping construct.
When the parser extracts commands from inside a control-flow block
that has output redirection (e.g. for ... done > file), the
redirect is not present in the segment’s command text. This field
carries the redirection so the eval layer can escalate the decision.
substitutions: Vec<SubstitutionSpan>Substitutions within this segment’s command text, in source order.
Each substitution is evaluated before this segment’s command.
start/end byte offsets index into command.
Trait Implementations§
Source§impl Clone for ShellSegment
impl Clone for ShellSegment
Source§fn clone(&self) -> ShellSegment
fn clone(&self) -> ShellSegment
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more