mirror of
https://git.proxmox.com/git/vma-to-pbs
synced 2025-04-28 16:28:59 +00:00
add a fallback for the --fingerprint argument
Fallback to the PBS_FINGERPRINT environment variable if the --fingerprint argument is not specified. Signed-off-by: Filip Schauer <f.schauer@proxmox.com>
This commit is contained in:
parent
68e1a2e7c8
commit
0d40a7001d
@ -7,7 +7,7 @@ edition = "2021"
|
|||||||
[dependencies]
|
[dependencies]
|
||||||
anyhow = "1.0"
|
anyhow = "1.0"
|
||||||
bincode = "1.3"
|
bincode = "1.3"
|
||||||
clap = { version = "4.0.32", features = ["cargo"] }
|
clap = { version = "4.0.32", features = ["cargo", "env"] }
|
||||||
md5 = "0.7.0"
|
md5 = "0.7.0"
|
||||||
scopeguard = "1.1.0"
|
scopeguard = "1.1.0"
|
||||||
serde = "1.0"
|
serde = "1.0"
|
||||||
|
@ -27,7 +27,7 @@ fn main() -> Result<()> {
|
|||||||
.long("fingerprint")
|
.long("fingerprint")
|
||||||
.value_name("FINGERPRINT")
|
.value_name("FINGERPRINT")
|
||||||
.help("Proxmox Backup Server Fingerprint")
|
.help("Proxmox Backup Server Fingerprint")
|
||||||
.required(true),
|
.env("PBS_FINGERPRINT"),
|
||||||
)
|
)
|
||||||
.arg(
|
.arg(
|
||||||
Arg::new("keyfile")
|
Arg::new("keyfile")
|
||||||
@ -72,9 +72,10 @@ fn main() -> Result<()> {
|
|||||||
|
|
||||||
let pbs_repository = matches.get_one::<String>("repository").unwrap().to_string();
|
let pbs_repository = matches.get_one::<String>("repository").unwrap().to_string();
|
||||||
let vmid = matches.get_one::<String>("vmid").unwrap().to_string();
|
let vmid = matches.get_one::<String>("vmid").unwrap().to_string();
|
||||||
|
|
||||||
let fingerprint = matches
|
let fingerprint = matches
|
||||||
.get_one::<String>("fingerprint")
|
.get_one::<String>("fingerprint")
|
||||||
.unwrap()
|
.context("Fingerprint not set. Use $PBS_FINGERPRINT or --fingerprint")?
|
||||||
.to_string();
|
.to_string();
|
||||||
|
|
||||||
let keyfile = matches.get_one::<String>("keyfile");
|
let keyfile = matches.get_one::<String>("keyfile");
|
||||||
|
Loading…
Reference in New Issue
Block a user