From 77f85c51beb044b6f087db7e5831469011b2348b Mon Sep 17 00:00:00 2001 From: Jason Gerecke Date: Sat, 23 Mar 2024 03:27:25 -0700 Subject: [PATCH] Fix rinex-cli commands (#213) * Correct issues with arguments to rinex-cli's identify command Fixes several errors that are encountered when trying to use the identify command: - The "all" and "anomalies" arguments were using the same short option identifier 'a'. The former has been renamed to 'A'. - The "header" argument had a short option identifier 'h' that conflicted with the implicit "help". The short option has been removed for "header". - The "station" argument was duplicated in its entirety Fixes: 6fc919091c13 * Correct issues with arguments to rinex-cli's graph command A runtime error is encountered when trying to use this command because there is no "no-graph" option anymore that these commands conflict with. Fixes: 6fc919091c13 * Correct issue with using rx-ecef and rx-geo options Rust panics with a variation of following error when trying to pass either of these options to rinex-cli: ~~~ Mismatch between definition and access of `rx-ecef`. Could not downcast to &alloc::string::String, need to downcast to alloc::string::String ~~~ Fixes: 6fc919091c13 --- rinex-cli/src/cli/graph.rs | 3 --- rinex-cli/src/cli/identify.rs | 9 +-------- rinex-cli/src/cli/mod.rs | 4 ++-- 3 files changed, 3 insertions(+), 13 deletions(-) diff --git a/rinex-cli/src/cli/graph.rs b/rinex-cli/src/cli/graph.rs index 1bf6f5c79..b4283330e 100644 --- a/rinex-cli/src/cli/graph.rs +++ b/rinex-cli/src/cli/graph.rs @@ -55,7 +55,6 @@ When METEO RINEX is provided, data from meteo sensors is plotted too.", .long("gf") .short('g') .action(ArgAction::SetTrue) - .conflicts_with("no-graph") .help("Plot Geometry Free (GF) signal combination."), ) .arg( @@ -70,7 +69,6 @@ When METEO RINEX is provided, data from meteo sensors is plotted too.", .long("nl") .short('n') .action(ArgAction::SetTrue) - .conflicts_with("no-graph") .help("Plot Narrow Lane (WL) signal combination."), ) .arg( @@ -78,7 +76,6 @@ When METEO RINEX is provided, data from meteo sensors is plotted too.", .long("mw") .short('m') .action(ArgAction::SetTrue) - .conflicts_with("no-graph") .help("Plot Melbourne-Wübbena (MW) signal combination."), ) .arg(Arg::new("cs").long("cs").action(ArgAction::SetTrue).help( diff --git a/rinex-cli/src/cli/identify.rs b/rinex-cli/src/cli/identify.rs index 9a824a90f..9fcb3255a 100644 --- a/rinex-cli/src/cli/identify.rs +++ b/rinex-cli/src/cli/identify.rs @@ -8,7 +8,7 @@ pub fn subcommand() -> Command { .arg_required_else_help(true) .about("RINEX data identification opmode") .arg( - Arg::new("all").short('a').action(ArgAction::SetTrue).help( + Arg::new("all").short('A').action(ArgAction::SetTrue).help( "Complete RINEX dataset(s) identification. Turns on all following algorithms.", ), ) @@ -36,7 +36,6 @@ pub fn subcommand() -> Command { .arg( Arg::new("header") .long("header") - .short('h') .action(ArgAction::SetTrue) .help("Extracts major header fields"), ) @@ -81,10 +80,4 @@ pub fn subcommand() -> Command { .action(ArgAction::SetTrue) .help("Identify all ground stations contained in CLK RINEX file(s)"), ) - .arg( - Arg::new("station") - .long("station") - .action(ArgAction::SetTrue) - .help("Identify all ground stations contained in CLK RINEX file(s)"), - ) } diff --git a/rinex-cli/src/cli/mod.rs b/rinex-cli/src/cli/mod.rs index 33d7c47c3..29f24d32b 100644 --- a/rinex-cli/src/cli/mod.rs +++ b/rinex-cli/src/cli/mod.rs @@ -283,12 +283,12 @@ Otherwise it gets automatically picked up.")) (x, y, z) } fn manual_ecef(&self) -> Option<(f64, f64, f64)> { - let desc = self.matches.get_one::<&String>("rx-ecef")?; + let desc = self.matches.get_one::("rx-ecef")?; let ecef = Self::parse_3d_coordinates(desc); Some(ecef) } fn manual_geodetic(&self) -> Option<(f64, f64, f64)> { - let desc = self.matches.get_one::<&String>("rx-geo")?; + let desc = self.matches.get_one::("rx-geo")?; let geo = Self::parse_3d_coordinates(desc); Some(geo) }