pub struct ShellSegment {
pub command: String,
pub redirection: Option<Redirection>,
}Expand description
A single evaluable command within a compound pipeline.
command contains the text that will be passed to base_command(),
tokenize(), and has_output_redirection() in the eval layer.
Any $(), backtick, or process substitution spans have been replaced
with __SUBST__ placeholders.
Fields§
§command: StringCommand text, with substitution spans replaced by __SUBST__.
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.
For segments where the redirect IS in the command text (e.g.
echo hi > file), this field may also be set but is redundant —
CommandContext::from_command will independently detect it.
Trait Implementations§
Source§impl Clone for ShellSegment
impl Clone for ShellSegment
Source§fn clone(&self) -> ShellSegment
fn clone(&self) -> ShellSegment
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more