From 6573c2d860382eb9db4b55ec6cc2e2a3c4813237 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klime=C5=A1?= Date: Fri, 20 Jan 2017 21:01:45 +0100 Subject: [PATCH] cli: TAB-completion for macsec.mode in interactive editor --- clients/cli/settings.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/clients/cli/settings.c b/clients/cli/settings.c index 7dbf1204b2..9422fd05cb 100644 --- a/clients/cli/settings.c +++ b/clients/cli/settings.c @@ -2180,7 +2180,19 @@ nmc_property_macsec_set_mode (NMSetting *setting, const char *prop, return TRUE; } -/* 'mode' */ +static const char ** +nmc_property_macsec_allowed_mode (NMSetting *setting, const char *prop) +{ + static const char **words = NULL; + + if (!words) + words = nm_utils_enum_get_values (nm_setting_macsec_mode_get_type(), + G_MININT, + G_MAXINT); + return words; +} + +/* 'validation' */ static char * nmc_property_macsec_get_validation (NMSetting *setting, NmcPropertyGetType get_type) { @@ -7983,7 +7995,7 @@ nmc_properties_init (void) nmc_property_macsec_set_mode, NULL, NULL, - NULL, + nmc_property_macsec_allowed_mode, NULL); nmc_add_prop_funcs (GLUE (MACSEC, ENCRYPT), nmc_property_macsec_get_encrypt,