rust-shell-script / rust_cmd_lib

Common rust command-line macros and utilities, to write shell-script like tasks in a clean, natural and rusty way
https://docs.rs/cmd_lib/
Apache License 2.0
1.05k stars 37 forks source link

Getting error code number #68

Open Elsie19 opened 2 months ago

Elsie19 commented 2 months ago

I cannot seem to find any function/macro in this library that I can use to get an exit code from a command. The closest I found is run_cmd!(), but that errors to something like:

Running ["bash" "-c" "time ./build/debug/foo"] exited with error; status code: 1 at src/main.rs:83

with no way to extract that 1 unless I parsed the string itself, which is not ideal.