#![allow(clippy::print_stderr, reason = "The CLI is allowed to use stderr")]
#![allow(clippy::print_stdout, reason = "The CLI is allowed to use stdout")]
use std::process::ExitCode;
use clap::Parser;
use tracing::error;
use ocpi_tariffs_cli::{setup_logging, Opts};
fn main() -> ExitCode {
let opts = Opts::parse();
if let Err(err) = setup_logging() {
eprintln!("{err}");
return ExitCode::FAILURE;
}
#[expect(if_let_rescope, reason = "The err object is not used in the else")]
if let Err(err) = opts.run() {
error!("{err}");
ExitCode::FAILURE
} else {
ExitCode::SUCCESS
}
}