add proper command line options and logging
This commit is contained in:
@ -1,3 +1,5 @@
|
||||
use std::str::FromStr;
|
||||
|
||||
use clap::Parser;
|
||||
use libvanity::vanity::VanityRequest;
|
||||
|
||||
@ -11,12 +13,20 @@ struct Args {
|
||||
|
||||
#[clap(help = "pattern of public key")]
|
||||
pattern: String,
|
||||
|
||||
#[clap(short, long, default_value = "WARN")]
|
||||
log_level: String,
|
||||
}
|
||||
|
||||
#[tokio::main]
|
||||
async fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
let args = Args::parse();
|
||||
|
||||
let level = tracing::Level::from_str(&args.log_level)?;
|
||||
tracing_subscriber::FmtSubscriber::builder()
|
||||
.with_max_level(level)
|
||||
.init();
|
||||
|
||||
let mut client =
|
||||
libvanity::vanity::vanity_service_client::VanityServiceClient::connect(args.endpoint)
|
||||
.await?;
|
||||
|
Reference in New Issue
Block a user