Provide a commit-specific version output

For builds made directly on the tag, the output of `--version` will
not change. For builds not made on a tagged commit, the output will
look something like this:

```
> swap --version

swap 0.7.0-117-g93161f9
```

Fixes #409.
This commit is contained in:
Thomas Eizinger 2021-07-07 17:44:49 +10:00
parent 93a69563a9
commit 714514edbc
No known key found for this signature in database
GPG key ID: 651AC83A6C6C8B96
5 changed files with 107 additions and 2 deletions

View file

@ -245,7 +245,12 @@ pub enum Command {
}
#[derive(structopt::StructOpt, Debug)]
#[structopt(name = "swap", about = "CLI for swapping BTC for XMR", author)]
#[structopt(
name = "swap",
about = "CLI for swapping BTC for XMR",
author,
version = env!("VERGEN_GIT_SEMVER_LIGHTWEIGHT")
)]
struct RawArguments {
// global is necessary to ensure that clap can match against testnet in subcommands
#[structopt(