Support --version

This commit is contained in:
Nikolay Edigaryev 2026-08-14 23:28:17 +01:00
parent 18f5a3338e
commit 92e2944ca9
2 changed files with 8 additions and 0 deletions

View File

@ -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

View File

@ -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,