Crates.io | exit_status |
lib.rs | exit_status |
version | 0.1.0 |
source | src |
created_at | 2021-02-24 21:06:02.053008 |
updated_at | 2021-02-24 21:06:02.053008 |
description | Simple proc-macro for enabling rust main function to return an exit status code |
homepage | https://github.com/ducaale/exit_status |
repository | https://github.com/ducaale/exit_status |
max_upload_size | |
id | 360117 |
size | 5,665 |
Simple proc-macro for enabling rust main function to return an exit status code.
#[exit_status::main]
fn main() -> anyhow::Result<i32> {
Ok(0)
}
// expands to
// fn main() -> anyhow::Result<()> {
// fn inner_main() -> anyhow::Result<i32> {
// {
// Ok(0)
// }
// }
// std::process::exit(inner_main()?);
// }