diff --git a/rust/Cargo.toml b/rust/Cargo.toml index 0e7f513..362a49d 100644 --- a/rust/Cargo.toml +++ b/rust/Cargo.toml @@ -13,7 +13,7 @@ tracing = "0.1" tracing-subscriber = { version = "0.3", features=["env-filter"] } tracing-appender = "0.2" tracing-core = "0.1" -structopt = "0.3" +clap = { version = "4.0", features = ["derive"] } anyhow = "1.0" smallbitvec = "2.5.0" serde = { version = "1.0", features=["rc", "derive"]} diff --git a/rust/src/gap_chat.rs b/rust/src/gap_chat.rs index b87423c..4a85415 100644 --- a/rust/src/gap_chat.rs +++ b/rust/src/gap_chat.rs @@ -16,40 +16,40 @@ use tracing::{debug, trace}; use std::io::Write; -use structopt::StructOpt; +use clap::Parser; use crate::vole::{solutions::Solutions, stats::Stats}; /// Store command line arguments -#[derive(StructOpt, Debug)] -#[structopt(name = "basic")] +#[derive(Parser, Debug)] +#[command(name = "basic")] pub struct Opt { /// Input file - #[structopt(parse(from_os_str))] + #[arg(value_parser)] input: Option, /// Output file - #[structopt(parse(from_os_str))] + #[arg(value_parser)] output: Option, /// Input pipe (as a POSIX file id) - #[structopt(short, long)] + #[arg(short, long)] inpipe: Option, /// Output pipe (as a POSIX file id) - #[structopt(short, long)] + #[arg(short, long)] outpipe: Option, /// TCP port - #[structopt(short, long)] + #[arg(short, long)] port: Option, /// Enable tracing - #[structopt(short, long)] + #[arg(short, long)] pub trace: bool, /// Be quiet (hide rust backtraces on crash) - #[structopt(short, long)] + #[arg(short, long)] pub quiet: bool, } @@ -119,7 +119,7 @@ impl Opt { lazy_static! { /// Global command line arguments - pub static ref OPTIONS: Opt = Opt::from_args(); + pub static ref OPTIONS: Opt = Opt::parse(); /// Global communication channel with GAP pub static ref GAP_CHAT: Mutex = { let opt = &OPTIONS;