use clap::Parser;
use engawa_client::run;
use engawa_shared::logger::setup_logger;
#[derive(Parser, Debug)]
#[command(name = "client")]
#[command(about = "WebSocket chat client with broadcast support and unique client ID", long_about = None)]
struct Args {
#[arg(short = 'c', long)]
client_id: String,
#[arg(short = 'u', long, default_value = "ws://127.0.0.1:8080/ws")]
url: String,
}
#[tokio::main]
async fn main() {
setup_logger(env!("CARGO_BIN_NAME"), "info");
let args = Args::parse();
if let Err(e) = run(args.url, args.client_id).await {
tracing::error!("Client error: {}", e);
std::process::exit(1);
}
}