Use anyhow for ergonomic CLI errors.
Section: Common CLI crate recipes
Return `Result` from main
rust
rust
fn main() -> anyhow::Result<()> {
println!("hello");
Ok(())
}Explanation
Returning `Result` from `main` is a clean pattern for CLI apps.
Learn the surrounding workflow
Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.
Related commands
Same sheet · prioritizing Common CLI crate recipes