mirror of
https://github.com/fabianlindfors/reshape.git
synced 2024-11-22 21:31:35 +03:00
Return anyhow::Result from main function
This should improve the way errors are displayed for end users with a list of causes.
This commit is contained in:
parent
78c0093412
commit
ef82acd480
@ -58,13 +58,9 @@ struct FindMigrationsOptions {
|
||||
dirs: Vec<String>,
|
||||
}
|
||||
|
||||
fn main() {
|
||||
fn main() -> anyhow::Result<()> {
|
||||
let opts: Opts = Opts::parse();
|
||||
|
||||
let result = run(opts);
|
||||
if let Err(e) = result {
|
||||
println!("Error: {}", e);
|
||||
}
|
||||
run(opts)
|
||||
}
|
||||
|
||||
fn run(opts: Opts) -> anyhow::Result<()> {
|
||||
|
Loading…
Reference in New Issue
Block a user