]> granicus.if.org Git - icinga2/commitdiff
Add auto-completion suggestions for built-in attributes
authorGunnar Beutner <gunnar@beutner.name>
Wed, 18 Mar 2015 07:19:36 +0000 (08:19 +0100)
committerGunnar Beutner <gunnar@beutner.name>
Wed, 18 Mar 2015 07:19:36 +0000 (08:19 +0100)
refs #8776

lib/cli/consolecommand.cpp

index a8d509e7c1c9ede1726a53f6fc7d9cf50aefa2e7..0e31f897dc851a569ef9a9c6bdda4a38eb692718 100644 (file)
@@ -144,6 +144,13 @@ static char *ConsoleCompleteHelper(const char *word, int state)
                                }
 
                                Type::Ptr type = value.GetReflectionType();
+
+                               for (int i = 0; i < type->GetFieldCount(); i++) {
+                                       Field field = type->GetFieldInfo(i);
+
+                                       AddSuggestion(matches, word, pword + "." + field.Name);
+                               }
+
                                Object::Ptr prototype = type->GetPrototype();
                                Dictionary::Ptr dict = dynamic_pointer_cast<Dictionary>(prototype);