1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
//! Zingo-Indexer daemon

use clap::Parser;
use std::path::PathBuf;
use zainodlib::{config::load_config, indexer::Indexer};

#[derive(Parser, Debug)]
#[command(name = "zindexer", about = "A server for Zingo-Indexer")]
struct Args {
    /// Path to the configuration file
    #[arg(short, long, value_name = "FILE")]
    config: Option<PathBuf>,
}

#[tokio::main]
async fn main() {
    Indexer::start(load_config(
        &Args::parse()
            .config
            .unwrap_or_else(|| PathBuf::from("./zainod/zindexer.toml")),
    ))
    .await
    .unwrap();
}