1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
//! v0.3.1 fix: clap soft-error terminations exit 0.
//!
//! Pre-fix, `mk --version` and `mk --help` exited 64 because the
//! `Cli::try_parse()` catch-all in `src/main.rs` mapped EVERY
//! `clap::Error` to `ExitCode::from(64)`. But clap returns soft-error
//! variants for help/version display:
//!
//! --version → ErrorKind::DisplayVersion
//! --help → ErrorKind::DisplayHelp
//!
//! These are not usage errors; the output is to stdout, not stderr, and
//! the canonical Unix convention is exit 0. The fix branches on
//! `e.kind()` and returns `ExitCode::SUCCESS` for those two variants,
//! preserving the catch-all 64 for real parse errors.
//!
//! Discovered during `bg002h/mnemonic-gui` v0.2.0 release prep
//! (companion: `bg002h/mnemonic-gui`).
use Command;