Skip to content

Documentation Error: e.exit now exits with code 2 as per #1327 #3332

@rlee287

Description

@rlee287

clap/src/parse/errors.rs

Lines 478 to 500 in d52b326

/// Prints the error and exits.
///
/// Depending on the error kind, this either prints to `stderr` and exits with a status of `1`
/// or prints to `stdout` and exits with a status of `0`.
pub fn exit(&self) -> ! {
if self.use_stderr() {
// Swallow broken pipe errors
let _ = self.print();
if self.wait_on_exit {
wlnerr!("\nPress [ENTER] / [RETURN] to continue...");
let mut s = String::new();
let i = io::stdin();
i.lock().read_line(&mut s).unwrap();
}
safe_exit(USAGE_CODE);
}
// Swallow broken pipe errors
let _ = self.print();
safe_exit(SUCCESS_CODE)
}

As per #1327, the USAGE_EXIT code is now 2, but the documentation still states that it exits with code 1.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions