Merge pull request #159 from vladon/feat/version-flag

feat: Add -V/--version flag to print version string
This commit is contained in:
Alexey 2026-02-19 13:13:51 +03:00 committed by GitHub
commit 34f5289fc3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 5 additions and 0 deletions

View File

@ -74,6 +74,7 @@ fn parse_cli() -> (String, bool, Option<String>) {
eprintln!("Options:");
eprintln!(" --silent, -s Suppress info logs");
eprintln!(" --log-level <LEVEL> debug|verbose|normal|silent");
eprintln!(" --version, -V Print version information");
eprintln!(" --help, -h Show this help");
eprintln!();
eprintln!("Setup (fire-and-forget):");
@ -92,6 +93,10 @@ fn parse_cli() -> (String, bool, Option<String>) {
eprintln!(" --no-start Don't start the service after install");
std::process::exit(0);
}
"--version" | "-V" => {
println!("telemt {}", env!("CARGO_PKG_VERSION"));
std::process::exit(0);
}
s if !s.starts_with('-') => {
config_path = s.to_string();
}