nu_experimental/options/
pipefail.rs

1use crate::*;
2
3/// Enable pipefail feature to ensure that the exit status of a pipeline
4/// accurately reflects the success or failure of all commands within that pipeline, not just
5/// the last one.
6///
7/// So it helps user writing more rubost nushell script.
8pub static PIPE_FAIL: ExperimentalOption = ExperimentalOption::new(&PipeFail);
9
10// No documentation needed here since this type isn't public.
11// The static above provides all necessary details.
12struct PipeFail;
13
14impl ExperimentalOptionMarker for PipeFail {
15    const IDENTIFIER: &'static str = "pipefail";
16    const DESCRIPTION: &'static str = "\
17        If an external command fails within a pipeline, $env.LAST_EXIT_CODE is set \
18        to the exit code of rightmost command which failed.";
19    const STATUS: Status = Status::OptIn;
20    const SINCE: Version = (0, 107, 1);
21    const ISSUE: u32 = 16760;
22}