Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

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

Closed
rlee287 opened this issue Jan 23, 2022 · 1 comment
Closed

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

rlee287 opened this issue Jan 23, 2022 · 1 comment

Comments

@rlee287
Copy link

rlee287 commented Jan 23, 2022

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.

@epage epage closed this as completed in 43673a1 Jan 24, 2022
@epage
Copy link
Member

epage commented Jan 24, 2022

Thanks for reporting this!

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants