38 lines
849 B
Rust
38 lines
849 B
Rust
mod config;
|
|
|
|
use crate::config::CONFIG;
|
|
use bson::{bson, Bson};
|
|
use clap::{Parser, Subcommand};
|
|
use log::debug;
|
|
use lz4_flex::block::{compress_prepend_size, decompress_size_prepended};
|
|
use tonic::*;
|
|
|
|
#[derive(Parser)]
|
|
#[command(author, version, about)]
|
|
#[command(propagate_version = true)]
|
|
struct Cli {
|
|
#[command(subcommand)]
|
|
command: Option<Commands>,
|
|
}
|
|
|
|
#[derive(Subcommand)]
|
|
enum Commands {
|
|
/// Starts uwusched
|
|
Start { role: Option<String> },
|
|
}
|
|
fn get_type_of<T>(_: &T) -> &'static str {
|
|
std::any::type_name::<T>()
|
|
}
|
|
|
|
fn main() {
|
|
std::env::set_var("RUST_LOG", CONFIG.log.level.clone());
|
|
pretty_env_logger::init();
|
|
// debug!("{:?}", CONFIG.node);
|
|
let cli = Cli::parse();
|
|
match &cli.command {
|
|
Some(Commands::Start { role }) => {
|
|
debug!("{:#?}", role)
|
|
}
|
|
None => {}
|
|
}
|
|
}
|