Skip to content

Commit

Permalink
Show version number when run without arguments
Browse files Browse the repository at this point in the history
Takes the version from `git describe --tags`
  • Loading branch information
bartnv committed Apr 24, 2022
1 parent c344e37 commit 7ca01e6
Show file tree
Hide file tree
Showing 3 changed files with 70 additions and 1 deletion.
64 changes: 64 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ regex = "1"
lazy_static = "1"
cow-utils = "0.1"
fast-float = "0.2"
git-version = "0.3"
6 changes: 5 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ use yaml_rust::yaml::Yaml;
use regex::Regex;
use lazy_static::lazy_static;
use cow_utils::CowUtils;
use git_version::git_describe;

macro_rules! fatalerr {
() => ({
Expand Down Expand Up @@ -470,7 +471,10 @@ fn main() {
else if args.len() == 3 {
bufread = Box::new(BufReader::new(File::open(&args[2]).unwrap_or_else(|err| fatalerr!("Error: failed to open input file '{}': {}", args[2], err))));
}
else { fatalerr!("Usage: {} <configfile> [xmlfile]", args[0]); }
else {
eprintln!("xml-to-postgres {}", git_describe!("--tags"));
fatalerr!("Usage: {} <configfile> [xmlfile]", args[0]);
}

let config = {
let mut config_str = String::new();
Expand Down

0 comments on commit 7ca01e6

Please sign in to comment.