summaryrefslogtreecommitdiff
path: root/clients
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2019-04-12 16:18:17 +0200
committerThomas Haller <thaller@redhat.com>2019-04-15 20:50:50 +0200
commit43d93e7c1f9d08973eab6ae5b4991775e336630e (patch)
treeb6fcda8ae57f3d6b0042bc5f743021d19eff69c8 /clients
parent68bd018a88b4696608ce141d2d0d8576bd148ce8 (diff)
downloadNetworkManager-43d93e7c1f9d08973eab6ae5b4991775e336630e.tar.gz
cli: tab complete only full D-Bus paths if there is no prefixth/cli-select-connection
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
Diffstat (limited to 'clients')
-rw-r--r--clients/cli/common.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/clients/cli/common.c b/clients/cli/common.c
index d94dbd0ba0..2fc8aaf643 100644
--- a/clients/cli/common.c
+++ b/clients/cli/common.c
@@ -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;