Skip to content

Commit

Permalink
Fix rinex-cli commands (#213)
Browse files Browse the repository at this point in the history
* 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: 6fc9190

* 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: 6fc9190

* 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: 6fc9190
  • Loading branch information
jigpu authored Mar 23, 2024
1 parent fd2444b commit 77f85c5
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 13 deletions.
3 changes: 0 additions & 3 deletions rinex-cli/src/cli/graph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -70,15 +69,13 @@ 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(
Arg::new("mw")
.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(
Expand Down
9 changes: 1 addition & 8 deletions rinex-cli/src/cli/identify.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.",
),
)
Expand Down Expand Up @@ -36,7 +36,6 @@ pub fn subcommand() -> Command {
.arg(
Arg::new("header")
.long("header")
.short('h')
.action(ArgAction::SetTrue)
.help("Extracts major header fields"),
)
Expand Down Expand Up @@ -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)"),
)
}
4 changes: 2 additions & 2 deletions rinex-cli/src/cli/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::<String>("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::<String>("rx-geo")?;
let geo = Self::parse_3d_coordinates(desc);
Some(geo)
}
Expand Down

0 comments on commit 77f85c5

Please sign in to comment.