Support --version
This commit is contained in:
parent
18f5a3338e
commit
92e2944ca9
|
|
@ -5,6 +5,8 @@ project_name: softnet
|
||||||
builds:
|
builds:
|
||||||
- builder: rust
|
- builder: rust
|
||||||
command: build
|
command: build
|
||||||
|
env:
|
||||||
|
- SOFTNET_VERSION={{ .Version }}-{{ .ShortCommit }}
|
||||||
targets:
|
targets:
|
||||||
- aarch64-apple-darwin
|
- aarch64-apple-darwin
|
||||||
- x86_64-apple-darwin
|
- x86_64-apple-darwin
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,13 @@ use system_configuration::sys::preferences::{
|
||||||
};
|
};
|
||||||
use uzers::{get_current_groupname, get_current_username, get_effective_uid};
|
use uzers::{get_current_groupname, get_current_username, get_effective_uid};
|
||||||
|
|
||||||
|
const VERSION: &str = match option_env!("SOFTNET_VERSION") {
|
||||||
|
Some(version) => version,
|
||||||
|
None => "unknown-unknown",
|
||||||
|
};
|
||||||
|
|
||||||
#[derive(Parser, Debug)]
|
#[derive(Parser, Debug)]
|
||||||
|
#[command(version = VERSION)]
|
||||||
struct Args {
|
struct Args {
|
||||||
#[clap(
|
#[clap(
|
||||||
long,
|
long,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue