lssa/wallet/src/main.rs

32 lines
778 B
Rust
Raw Normal View History

2025-08-06 14:56:58 +03:00
use anyhow::Result;
2025-10-20 10:01:54 +03:00
use clap::{CommandFactory, Parser};
2025-08-06 14:56:58 +03:00
use tokio::runtime::Builder;
2025-10-15 15:17:30 +03:00
use wallet::{Args, execute_continious_run, execute_subcommand};
2025-08-06 14:56:58 +03:00
pub const NUM_THREADS: usize = 2;
fn main() -> Result<()> {
let runtime = Builder::new_multi_thread()
.worker_threads(NUM_THREADS)
.enable_all()
.build()
.unwrap();
let args = Args::parse();
2025-08-07 14:07:34 +03:00
env_logger::init();
2025-08-06 14:56:58 +03:00
runtime.block_on(async move {
2025-10-15 15:17:30 +03:00
if let Some(command) = args.command {
execute_subcommand(command).await.unwrap();
} else if args.continious_run {
execute_continious_run().await.unwrap();
} else {
2025-10-20 10:01:54 +03:00
let help = Args::command().render_long_help();
println!("{help}");
2025-10-15 15:17:30 +03:00
}
2025-08-06 14:56:58 +03:00
});
Ok(())
}