use complete_file_name from proxmox-router 1.1

This commit is contained in:
Dietmar Maurer
2021-10-13 12:55:51 +02:00
parent 82f5ad18f0
commit b3f279e2d9
20 changed files with 56 additions and 110 deletions

View File

@ -23,7 +23,7 @@ pathpatterns = "0.1.2"
pxar = { version = "0.10.1", features = [ "tokio-io" ] }
proxmox = { version = "0.14.0", features = [ "sortable-macro" ] }
proxmox-router = { version = "1", features = [ "cli" ] }
proxmox-router = { version = "1.1", features = [ "cli" ] }
proxmox-schema = { version = "1", features = [ "api-macro" ] }
proxmox-time = "1"

View File

@ -7,7 +7,8 @@ use serde_json::Value;
use proxmox::sys::linux::tty;
use proxmox::tools::fs::{file_get_contents, replace_file, CreateOptions};
use proxmox_router::cli::{
format_and_print_result_full, get_output_format, CliCommand, CliCommandMap, ColumnConfig,
complete_file_name, format_and_print_result_full, get_output_format,
CliCommand, CliCommandMap, ColumnConfig,
OUTPUT_FORMAT,
};
use proxmox_schema::{api, ApiType, ReturnType};
@ -451,35 +452,35 @@ fn paper_key(
pub fn cli() -> CliCommandMap {
let key_create_cmd_def = CliCommand::new(&API_METHOD_CREATE)
.arg_param(&["path"])
.completion_cb("path", pbs_tools::fs::complete_file_name);
.completion_cb("path", complete_file_name);
let key_import_with_master_key_cmd_def = CliCommand::new(&API_METHOD_IMPORT_WITH_MASTER_KEY)
.arg_param(&["master-keyfile"])
.completion_cb("master-keyfile", pbs_tools::fs::complete_file_name)
.completion_cb("master-keyfile", complete_file_name)
.arg_param(&["encrypted-keyfile"])
.completion_cb("encrypted-keyfile", pbs_tools::fs::complete_file_name)
.completion_cb("encrypted-keyfile", complete_file_name)
.arg_param(&["path"])
.completion_cb("path", pbs_tools::fs::complete_file_name);
.completion_cb("path", complete_file_name);
let key_change_passphrase_cmd_def = CliCommand::new(&API_METHOD_CHANGE_PASSPHRASE)
.arg_param(&["path"])
.completion_cb("path", pbs_tools::fs::complete_file_name);
.completion_cb("path", complete_file_name);
let key_create_master_key_cmd_def = CliCommand::new(&API_METHOD_CREATE_MASTER_KEY);
let key_import_master_pubkey_cmd_def = CliCommand::new(&API_METHOD_IMPORT_MASTER_PUBKEY)
.arg_param(&["path"])
.completion_cb("path", pbs_tools::fs::complete_file_name);
.completion_cb("path", complete_file_name);
let key_show_master_pubkey_cmd_def = CliCommand::new(&API_METHOD_SHOW_MASTER_PUBKEY)
.arg_param(&["path"])
.completion_cb("path", pbs_tools::fs::complete_file_name);
.completion_cb("path", complete_file_name);
let key_show_cmd_def = CliCommand::new(&API_METHOD_SHOW_KEY)
.arg_param(&["path"])
.completion_cb("path", pbs_tools::fs::complete_file_name);
.completion_cb("path", complete_file_name);
let paper_key_cmd_def = CliCommand::new(&API_METHOD_PAPER_KEY)
.arg_param(&["path"])
.completion_cb("path", pbs_tools::fs::complete_file_name);
.completion_cb("path", complete_file_name);
CliCommandMap::new()
.insert("create", key_create_cmd_def)

View File

@ -1429,13 +1429,13 @@ fn main() {
.arg_param(&["backupspec"])
.completion_cb("repository", complete_repository)
.completion_cb("backupspec", complete_backup_source)
.completion_cb("keyfile", pbs_tools::fs::complete_file_name)
.completion_cb("master-pubkey-file", pbs_tools::fs::complete_file_name)
.completion_cb("keyfile", complete_file_name)
.completion_cb("master-pubkey-file", complete_file_name)
.completion_cb("chunk-size", complete_chunk_size);
let benchmark_cmd_def = CliCommand::new(&API_METHOD_BENCHMARK)
.completion_cb("repository", complete_repository)
.completion_cb("keyfile", pbs_tools::fs::complete_file_name);
.completion_cb("keyfile", complete_file_name);
let list_cmd_def = CliCommand::new(&API_METHOD_LIST_BACKUP_GROUPS)
.completion_cb("repository", complete_repository);
@ -1448,7 +1448,7 @@ fn main() {
.completion_cb("repository", complete_repository)
.completion_cb("snapshot", complete_group_or_snapshot)
.completion_cb("archive-name", complete_archive_name)
.completion_cb("target", pbs_tools::fs::complete_file_name);
.completion_cb("target", complete_file_name);
let prune_cmd_def = CliCommand::new(&API_METHOD_PRUNE)
.arg_param(&["group"])

View File

@ -94,7 +94,7 @@ pub fn mount_cmd_def() -> CliCommand {
.completion_cb("repository", complete_repository)
.completion_cb("snapshot", complete_group_or_snapshot)
.completion_cb("archive-name", complete_pxar_archive_name)
.completion_cb("target", pbs_tools::fs::complete_file_name)
.completion_cb("target", complete_file_name)
}
pub fn map_cmd_def() -> CliCommand {

View File

@ -403,8 +403,8 @@ pub fn snapshot_mgtm_cli() -> CliCommandMap {
CliCommand::new(&API_METHOD_UPLOAD_LOG)
.arg_param(&["snapshot", "logfile"])
.completion_cb("snapshot", complete_backup_snapshot)
.completion_cb("logfile", pbs_tools::fs::complete_file_name)
.completion_cb("keyfile", pbs_tools::fs::complete_file_name)
.completion_cb("logfile", complete_file_name)
.completion_cb("keyfile", complete_file_name)
.completion_cb("repository", complete_repository)
)
}