exit_status

Crates.ioexit_status
lib.rsexit_status
version0.1.0
sourcesrc
created_at2021-02-24 21:06:02.053008
updated_at2021-02-24 21:06:02.053008
descriptionSimple proc-macro for enabling rust main function to return an exit status code
homepagehttps://github.com/ducaale/exit_status
repositoryhttps://github.com/ducaale/exit_status
max_upload_size
id360117
size5,665
Mohamed Daahir (ducaale)

documentation

https://github.com/ducaale/exit_status

README

exit_status

Simple proc-macro for enabling rust main function to return an exit status code.

Example

#[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()?);
// }
Commit count: 6

cargo fmt