From c7dc51d52b92565431f7b0d4c8306ca742df1550 Mon Sep 17 00:00:00 2001 From: Imbris Date: Thu, 21 Sep 2023 22:48:54 -0400 Subject: [PATCH] Fix swarm binary to use clap --- client/src/bin/swarm/main.rs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/client/src/bin/swarm/main.rs b/client/src/bin/swarm/main.rs index 0f90b170d3..3c122421f5 100644 --- a/client/src/bin/swarm/main.rs +++ b/client/src/bin/swarm/main.rs @@ -1,3 +1,4 @@ +use clap::Parser; use common::{ comp, terrain::{CoordinateConversions, TerrainChunkSize}, @@ -12,29 +13,30 @@ use std::{ thread, time::{Duration, SystemTime}, }; -use structopt::StructOpt; use tokio::runtime::Runtime; use vek::*; use veloren_client::{addr::ConnectionArgs, Client}; const CHUNK_SIZE: f32 = TerrainChunkSize::RECT_SIZE.x as f32; -#[derive(Clone, Copy, StructOpt)] +#[derive(Clone, Copy, Parser)] struct Opt { /// Number of clients to spin up + #[arg(value_name = "CLIENT_COUNT")] size: u32, /// View distance of each client + #[arg(value_name = "VIEW_DISTANCE")] vd: u32, /// Distribution of the clients, if not clustered they are dispersed - #[structopt(short, long)] + #[arg(short, long)] clustered: bool, /// Whether the clients should move - #[structopt(short, long)] + #[arg(short, long)] movement: bool, } fn main() { - let opt = Opt::from_args(); + let opt = Opt::parse(); // Start logging let _guards = common_frontend::init_stdout(None); // Run clients and stuff