Skip to content

Commit

Permalink
Remove quit
Browse files Browse the repository at this point in the history
  • Loading branch information
goto-bus-stop committed Jul 10, 2024
1 parent 05266b3 commit e9e72b4
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 20 deletions.
16 changes: 0 additions & 16 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ log = "0.4.8"
maud = "0.26.0"
native-tls = "0.2.10"
nom = { version = "7.0.0", features = ["std"], default-features = false }
quit = "2.0.0"
r2d2 = "0.8.9"
r2d2_sqlite = "0.24.0"
rusqlite = { version = "0.31.0", features = ["bundled"] }
Expand Down
7 changes: 4 additions & 3 deletions src/main.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use std::process::ExitCode;
use anyhow::{bail, Result};
use gumdrop::{Options, ParsingStyle};
use sekshibot::{ConnectionOptions, SekshiBot, UnauthorizedError};
Expand All @@ -14,7 +15,7 @@ pub struct Cli {
pub help: bool,
}

fn main() -> Result<()> {
fn main() -> Result<ExitCode> {
femme::with_level(log::LevelFilter::Info);
let args = Cli::parse_args_or_exit(ParsingStyle::AllOptions);
log::info!("args: {:?}", args);
Expand All @@ -40,11 +41,11 @@ fn main() -> Result<()> {
})();

match result {
Ok(_) => Ok(()),
Ok(_) => Ok(ExitCode::SUCCESS),
Err(err) => {
if err.is::<UnauthorizedError>() {
eprintln!("Error: {err}");
quit::with_code(75);
Ok(ExitCode::from(75))
} else {
Err(err)
}
Expand Down

0 comments on commit e9e72b4

Please sign in to comment.