From 0ec9e1b010c8bdfbc3e9262187cec5216fa107d3 Mon Sep 17 00:00:00 2001 From: Dietmar Maurer Date: Mon, 9 Dec 2019 13:14:32 +0100 Subject: [PATCH] src/bin/proxmox-backup-client.rs: impl. and use complete_pxar_archive_name --- src/bin/proxmox-backup-client.rs | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/src/bin/proxmox-backup-client.rs b/src/bin/proxmox-backup-client.rs index 8a01de2b..01106548 100644 --- a/src/bin/proxmox-backup-client.rs +++ b/src/bin/proxmox-backup-client.rs @@ -1358,6 +1358,20 @@ fn complete_archive_name(arg: &str, param: &HashMap) -> Vec) -> Vec { + complete_server_file_name(arg, param) + .iter() + .filter_map(|v| { + let name = strip_server_file_expenstion(&v); + if name.ends_with(".pxar") { + Some(name) + } else { + None + } + }) + .collect() +} + fn complete_chunk_size(_arg: &str, _param: &HashMap) -> Vec { let mut result = vec![]; @@ -1895,7 +1909,7 @@ fn catalog_mgmt_cli() -> CliCommandMap { let catalog_shell_cmd_def = CliCommand::new(&API_METHOD_SHELL) .arg_param(&["snapshot", "archive-name"]) .completion_cb("repository", complete_repository) - .completion_cb("archive-name", complete_archive_name) + .completion_cb("archive-name", complete_pxar_archive_name) .completion_cb("snapshot", complete_group_or_snapshot); #[sortable] @@ -2251,7 +2265,7 @@ We do not extraxt '.pxar' archives when writing to stdandard output. .arg_param(&["snapshot", "archive-name", "target"]) .completion_cb("repository", complete_repository) .completion_cb("snapshot", complete_group_or_snapshot) - .completion_cb("archive-name", complete_archive_name) + .completion_cb("archive-name", complete_pxar_archive_name) .completion_cb("target", tools::complete_file_name);