Skip to content

Commit

Permalink
add exit code 1 for invalid number
Browse files Browse the repository at this point in the history
  • Loading branch information
megascrapper committed Mar 31, 2022
1 parent 9ae5cb5 commit 486b95e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use std::process::exit;
use clap::Parser;
use ansi_term::Colour::Red;
use factordb::Number;
Expand Down Expand Up @@ -26,6 +27,9 @@ fn main() {
}
}
},
Err(e) => eprintln!( "{} {}", Red.paint("error:"), e)
Err(e) => {
eprintln!("{} {}", Red.paint("error:"), e);
exit(1);
}
}
}

0 comments on commit 486b95e

Please sign in to comment.