yac
/
yacexits
Archived
3
0
Fork 0
This repository has been archived on 2024-04-25. You can view files and clone it, but cannot push or open issues or pull requests.
yacexits/src/main.rs

15 lines
379 B
Rust

#![no_main]
use yacexits::*;
#[no_mangle]
fn rust_main(args: Args,) -> Result<u32, (String, u32)> {
let argv = args.into_iter().collect::<Vec<&str>>();
for (i, arg) in argv.iter().enumerate() {
println!("argv[{}]: {}", i, arg)
}
let (message, code) = ("bingus".to_string(), EX_USAGE);
let error = YacError { message, code };
Err(<(String, u32)>::from(error))
}