Function pacaptr::exec::grep_print_with_header

source ·
pub fn grep_print_with_header(
    text: &str,
    patterns: &[&str],
    header_lines: usize
) -> Result<()>
Expand description

Prints the result of grep line by line, with header_lines of header prepended. If header_lines >= text.lines().count(), then text is printed without changes.

§Errors

Returns an Error::OtherError when any of the regex patterns is ill-formed.