mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-06-05 07:48:17 +02:00
cli: tab complete only full D-Bus paths if there is no prefix
When tab completing connections by path name without any already
typed parts, only suggest full D-Bus paths. The numbers are duplicate
and not preferred.
Before:
$ nmcli connection show path <TAB>
Display all 118 possibilities? (y or n)
1 46 /org/freedesktop/NetworkManager/Settings/29
10 47 /org/freedesktop/NetworkManager/Settings/3
11 48 /org/freedesktop/NetworkManager/Settings/30
12 49 /org/freedesktop/NetworkManager/Settings/31
13 5 /org/freedesktop/NetworkManager/Settings/32
Afterwards:
$ nmcli connection show path <TAB>
/org/freedesktop/NetworkManager/Settings/1 /org/freedesktop/NetworkManager/Settings/28 /org/freedesktop/NetworkManager/Settings/46
...
and
$ nmcli connection modify path 4<TAB>
4 40 41 42 43 44 45 46 47 48 49
This commit is contained in:
parent
68bd018a88
commit
43d93e7c1f
1 changed files with 1 additions and 1 deletions
|
|
@ -465,7 +465,7 @@ nmc_find_connection (const GPtrArray *connections,
|
|||
v = nm_connection_get_path (connection);
|
||||
v_num = nm_utils_dbus_path_get_last_component (v);
|
||||
if (complete && (filter_type || *filter_val))
|
||||
nmc_complete_strings (filter_val, v, filter_type ? v_num : NULL);
|
||||
nmc_complete_strings (filter_val, v, (*filter_val ? v_num : NULL));
|
||||
if ( nm_streq0 (filter_val, v)
|
||||
|| (filter_type && nm_streq0 (filter_val, v_num)))
|
||||
goto found;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue