Skip to content

Commit

Permalink
Re-add --version flag that was accidentally removed in 0.33.0
Browse files Browse the repository at this point in the history
  • Loading branch information
taiki-e committed Jan 27, 2022
1 parent 5196df2 commit a7eedda
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -698,6 +698,7 @@ impl window::State for AppState {

/// URDF visualizer
#[derive(Parser, Debug, Deserialize)]
#[clap(version)]
#[serde(rename_all = "kebab-case")]
#[non_exhaustive]
pub struct Opt {
Expand Down
14 changes: 14 additions & 0 deletions tests/test.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
use std::process::Command;

#[test]
fn version() {
let output = Command::new(env!("CARGO_BIN_EXE_urdf-viz"))
.arg("--version")
.output()
.unwrap();
assert!(output.status.success());
assert_eq!(
String::from_utf8(output.stdout).unwrap().trim(),
format!("urdf-viz {}", env!("CARGO_PKG_VERSION"))
);
}

0 comments on commit a7eedda

Please sign in to comment.