// SPDX-License-Identifier: Apache-2.0

#![deny(clippy::all)]
#![deny(clippy::pedantic)]
#![forbid(unsafe_code)]

mod cli;

use malwaredb_client::MdbClient;

use std::process::ExitCode;

use clap::Parser;

#[tokio::main]
async fn main() -> anyhow::Result<ExitCode> {
    if std::env::var("RUST_LOG_JSON").is_ok() {
        tracing_subscriber::fmt::fmt()
            .json()
            .with_env_filter(tracing_subscriber::EnvFilter::from_default_env())
            .init();
    } else {
        tracing_subscriber::fmt::init();
    }

    let app = cli::Options::parse();
    app.execute().await
}
