group filter: rename CLI/API/Config "groups" option to "group-filter"

we even use that for basically all the related schema names, "groups"
allone is just rather not so telling, i.e., "groups" what?

While due to the additive nature of `group-filter` is not the best
possible name for passing multiple arguments on the CLI (the web-ui
can present this more UX-friendly anyway) due to possible confusion
about if the filter act like AND vs OR it can be documented and even
if a user is confused they still are safe on more being synced than
less. Also, the original param name wasn't really _that_ better in
that regards

Dietmar also suggested to use singular for the CLI option, while
there can be more they're passed over repeating the option, each with
a single filter.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Thomas Lamprecht
2021-11-18 09:50:47 +01:00
parent efd2713aa8
commit 062edce27f
6 changed files with 23 additions and 23 deletions

View File

@ -240,7 +240,7 @@ fn task_mgmt_cli() -> CommandLineInterface {
schema: REMOVE_VANISHED_BACKUPS_SCHEMA,
optional: true,
},
"groups": {
"group-filter": {
schema: GROUP_FILTER_LIST_SCHEMA,
optional: true,
},
@ -257,7 +257,7 @@ async fn pull_datastore(
remote_store: String,
local_store: String,
remove_vanished: Option<bool>,
groups: Option<Vec<GroupFilter>>,
group_filter: Option<Vec<GroupFilter>>,
param: Value,
) -> Result<Value, Error> {
@ -271,8 +271,8 @@ async fn pull_datastore(
"remote-store": remote_store,
});
if groups.is_some() {
args["groups"] = json!(groups);
if group_filter.is_some() {
args["group-filter"] = json!(group_filter);
}
if let Some(remove_vanished) = remove_vanished {
@ -400,7 +400,7 @@ async fn run() -> Result<(), Error> {
.completion_cb("local-store", pbs_config::datastore::complete_datastore_name)
.completion_cb("remote", pbs_config::remote::complete_remote_name)
.completion_cb("remote-store", complete_remote_datastore_name)
.completion_cb("groups", complete_remote_datastore_group_filter)
.completion_cb("group_filter", complete_remote_datastore_group_filter)
)
.insert(
"verify",