Configure structopt to report the right version

By default, structopt reports the value provided by
the env var CARGO_PKG_VERSION, feeded by Cargo when reading
Cargo.toml. However for Garage we use a versioning based on git,
so we often report a version that is behind the real version.
In this commit, we create garage_util::version::garage() that
reports the right version and configure all structopt subcommands
to call this function instead of using the env var.
This commit is contained in:
Quentin Dufour
2022-08-10 12:18:44 +02:00
committed by Alex Auvolat
parent d47af7b173
commit cd5fa90c68
12 changed files with 82 additions and 75 deletions
Generated
+1 -1
View File
@@ -1079,7 +1079,6 @@ dependencies = [
"futures-util",
"garage_util 0.7.0",
"gethostname",
"git-version",
"hex",
"hyper",
"k8s-openapi",
@@ -1177,6 +1176,7 @@ dependencies = [
"chrono",
"err-derive 0.3.1",
"futures",
"git-version",
"hex",
"http",
"hyper",