mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager
synced 2024-07-21 18:24:49 +00:00
cli: fix connections completion
Let the matching continue when we are autocompleting arguments and we have already found 'id', 'uuid' or 'path'. Before: # nmcli connection modify path<TAB> path After: # nmcli connection modify path<TAB> path pathfinder-wifi
This commit is contained in:
parent
6cba687bb3
commit
e27963d17f
|
@ -1653,16 +1653,17 @@ get_connection (NmCli *nmc, int *argc, char ***argv, int *pos, GError **error)
|
|||
if (*argc == 1 && nmc->complete)
|
||||
nmc_complete_strings (**argv, "id", "uuid", "path", NULL);
|
||||
|
||||
if ( strcmp (**argv, "id") == 0
|
||||
|| strcmp (**argv, "uuid") == 0
|
||||
|| strcmp (**argv, "path") == 0) {
|
||||
selector = **argv;
|
||||
(*argc)--;
|
||||
(*argv)++;
|
||||
if (!*argc) {
|
||||
g_set_error (error, NMCLI_ERROR, NMC_RESULT_ERROR_USER_INPUT,
|
||||
_("%s argument is missing"), selector);
|
||||
return NULL;
|
||||
if (NM_IN_STRSET (**argv, "id", "uuid", "path")) {
|
||||
if (*argc == 1) {
|
||||
if (!nmc->complete) {
|
||||
g_set_error (error, NMCLI_ERROR, NMC_RESULT_ERROR_USER_INPUT,
|
||||
_("%s argument is missing"), selector);
|
||||
return NULL;
|
||||
}
|
||||
} else {
|
||||
selector = **argv;
|
||||
(*argv)++;
|
||||
(*argc)--;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue