Skip to main content

strip_exit_marker

Function strip_exit_marker 

Source
pub fn strip_exit_marker(input: &str) -> (String, Option<i32>)
Expand description

Split a trailing __SQZ_EXIT_<n>__ marker off input.

Returns the input with the marker (and the separator newline the producer added) removed, plus the status to exit with. When no marker is present the input is returned unchanged with None.

The match is deliberately strict: the marker must be the final non-empty line, consist of nothing but the literal frame, an optional - and 1 to 10 digits, and sit at the very end of the stream. A command whose real output happens to contain the string mid-stream is left alone.