Open jplatte opened 2 years ago
SGTM!
Should probably add a .kind()
method which returns a fieldless nonexhaustive enum.
Thinking about the broader problem, I think for myself I usually use the following pattern:
if cmd!(sh, "my-tool --version").run().is_err() {
eprintln!("Install my tool");
return
}
That is perhaps a better behavior than catching the error after-the-fact, because:
Use case: Some automation tools require other binaries to be installed. I would like to catch when that is not the case and print installation instructions.