diff options
author | Jiří Klimeš <jklimes@redhat.com> | 2015-06-12 13:51:47 +0200 |
---|---|---|
committer | Jiří Klimeš <jklimes@redhat.com> | 2015-06-12 13:56:39 +0200 |
commit | 4427362e7c0fe3779a1aa286fbefcf83f29abe9c (patch) | |
tree | 285c0a2a94c4afaacd92378ea142a11a00bff124 | |
parent | 28d0049bd8606c7c0da13b50fd4903d7b67f4823 (diff) | |
download | NetworkManager-jk/libnm-nmcli-metadata-unsquashed.tar.gz |
cli: complete filenames for more propertiesjk/libnm-nmcli-metadata-unsquashed
Use nm_setting_property_maybe_filename() and special case Team config property
for which nmcli accepts filenames.
-rw-r--r-- | clients/cli/connections.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/clients/cli/connections.c b/clients/cli/connections.c index cd45352850..7a86ae9562 100644 --- a/clients/cli/connections.c +++ b/clients/cli/connections.c @@ -6379,17 +6379,25 @@ should_complete_files (const char *prompt, const char *line) { NMSetting *setting; char *property; - gboolean is_filename = FALSE; + gboolean filename = FALSE; get_setting_and_property (prompt, line, &setting, &property); - if (setting && property) - is_filename = nm_setting_property_is_filename (setting, property); + if (setting && property) { + filename = nm_setting_property_is_filename (setting, property) + || nm_setting_property_maybe_filename (setting, property); + + /* Special case for team.config, team-port.config + nmcli accepts filenames for these */ + if ( (NM_IS_SETTING_TEAM (setting) || NM_IS_SETTING_TEAM_PORT (setting)) + && !strcmp (property, "config")) + filename = TRUE; + } if (setting) g_object_unref (setting); g_free (property); - return is_filename; + return filename; } static gboolean |