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

@ -6,7 +6,7 @@ edition = "2018"
description = "Simple RRD database implementation."
[dev-dependencies]
proxmox-router = "1"
proxmox-router = "1.1"
[dependencies]
anyhow = "1.0"

View File

@ -7,7 +7,7 @@ use serde::{Serialize, Deserialize};
use serde_json::json;
use proxmox_router::RpcEnvironment;
use proxmox_router::cli::{run_cli_command, CliCommand, CliCommandMap, CliEnvironment};
use proxmox_router::cli::{run_cli_command, complete_file_name, CliCommand, CliCommandMap, CliEnvironment};
use proxmox_schema::{api, parse_property_string};
use proxmox_schema::{ApiStringFormat, ApiType, IntegerSchema, Schema, StringSchema};
@ -350,55 +350,55 @@ fn main() -> Result<(), Error> {
"create",
CliCommand::new(&API_METHOD_CREATE_RRD)
.arg_param(&["path"])
//.completion_cb("path", pbs_tools::fs::complete_file_name)
.completion_cb("path", complete_file_name)
)
.insert(
"dump",
CliCommand::new(&API_METHOD_DUMP_RRD)
.arg_param(&["path"])
//.completion_cb("path", pbs_tools::fs::complete_file_name)
.completion_cb("path", complete_file_name)
)
.insert(
"fetch",
CliCommand::new(&API_METHOD_FETCH_RRD)
.arg_param(&["path"])
//.completion_cb("path", pbs_tools::fs::complete_file_name)
.completion_cb("path", complete_file_name)
)
.insert(
"first",
CliCommand::new(&API_METHOD_FIRST_UPDATE_TIME)
.arg_param(&["path"])
//.completion_cb("path", pbs_tools::fs::complete_file_name)
.completion_cb("path", complete_file_name)
)
.insert(
"info",
CliCommand::new(&API_METHOD_RRD_INFO)
.arg_param(&["path"])
//.completion_cb("path", pbs_tools::fs::complete_file_name)
.completion_cb("path", complete_file_name)
)
.insert(
"last",
CliCommand::new(&API_METHOD_LAST_UPDATE_TIME)
.arg_param(&["path"])
//.completion_cb("path", pbs_tools::fs::complete_file_name)
.completion_cb("path", complete_file_name)
)
.insert(
"lastupdate",
CliCommand::new(&API_METHOD_LAST_UPDATE)
.arg_param(&["path"])
//.completion_cb("path", pbs_tools::fs::complete_file_name)
.completion_cb("path", complete_file_name)
)
.insert(
"resize",
CliCommand::new(&API_METHOD_RESIZE_RRD)
.arg_param(&["path"])
//.completion_cb("path", pbs_tools::fs::complete_file_name)
.completion_cb("path", complete_file_name)
)
.insert(
"update",
CliCommand::new(&API_METHOD_UPDATE_RRD)
.arg_param(&["path"])
//.completion_cb("path", pbs_tools::fs::complete_file_name)
.completion_cb("path", complete_file_name)
)
;