mirror of
https://git.proxmox.com/git/vma-to-pbs
synced 2025-08-05 06:38:23 +00:00
Add missing implementation of the --version option
This was left in the help text but was not implemented during the
transition from clap to picoargs in 80fb0a4a
.
Signed-off-by: Filip Schauer <f.schauer@proxmox.com>
This commit is contained in:
parent
cafd76d1f3
commit
615173c7b5
@ -65,6 +65,7 @@ Options:
|
|||||||
-V, --version
|
-V, --version
|
||||||
Print version
|
Print version
|
||||||
";
|
";
|
||||||
|
const VERSION: &str = env!("CARGO_PKG_VERSION");
|
||||||
|
|
||||||
fn parse_args() -> Result<BackupVmaToPbsArgs, Error> {
|
fn parse_args() -> Result<BackupVmaToPbsArgs, Error> {
|
||||||
let mut args: Vec<_> = std::env::args_os().collect();
|
let mut args: Vec<_> = std::env::args_os().collect();
|
||||||
@ -74,6 +75,8 @@ fn parse_args() -> Result<BackupVmaToPbsArgs, Error> {
|
|||||||
let options = [
|
let options = [
|
||||||
"-h",
|
"-h",
|
||||||
"--help",
|
"--help",
|
||||||
|
"-V",
|
||||||
|
"--version",
|
||||||
"-c",
|
"-c",
|
||||||
"--compress",
|
"--compress",
|
||||||
"-e",
|
"-e",
|
||||||
@ -112,6 +115,9 @@ fn parse_args() -> Result<BackupVmaToPbsArgs, Error> {
|
|||||||
if args.contains(["-h", "--help"]) {
|
if args.contains(["-h", "--help"]) {
|
||||||
print!("{CMD_HELP}");
|
print!("{CMD_HELP}");
|
||||||
std::process::exit(0);
|
std::process::exit(0);
|
||||||
|
} else if args.contains(["-V", "--version"]) {
|
||||||
|
println!("Version: {VERSION}");
|
||||||
|
std::process::exit(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
let pbs_repository = args.value_from_str("--repository")?;
|
let pbs_repository = args.value_from_str("--repository")?;
|
||||||
|
Loading…
Reference in New Issue
Block a user