An open API service indexing awesome lists of open source software.

https://github.com/ducaale/exit_status

a proc-macro that allows rust's main function to return an exit status code
https://github.com/ducaale/exit_status

proc-macro rust

Last synced: 8 months ago
JSON representation

a proc-macro that allows rust's main function to return an exit status code

Awesome Lists containing this project

README

          

# exit_status
[![Version info](https://img.shields.io/crates/v/exit_status.svg)](https://crates.io/crates/exit_status)

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

## Example
```rust
#[exit_status::main]
fn main() -> anyhow::Result {
Ok(0)
}

// expands to
// fn main() -> anyhow::Result<()> {
// fn inner_main() -> anyhow::Result {
// {
// Ok(0)
// }
// }
// std::process::exit(inner_main()?);
// }
```