From 4cf46de5ab86af92db1478ccc07b90d7518cdc75 Mon Sep 17 00:00:00 2001 From: Michael Friedrich Date: Mon, 27 Oct 2014 14:13:55 +0100 Subject: [PATCH] Cli: Fix autocompletion on Debian refs #7246 --- icinga-app/icinga.cpp | 4 ++-- lib/cli/CMakeLists.txt | 2 +- lib/cli/repositoryobjectcommand.cpp | 2 ++ 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/icinga-app/icinga.cpp b/icinga-app/icinga.cpp index e63dee3a9..2fb6a9322 100644 --- a/icinga-app/icinga.cpp +++ b/icinga-app/icinga.cpp @@ -243,9 +243,9 @@ int Main(void) } } - Logger::SetConsoleLogSeverity(logLevel); - if (!autocomplete) { + Logger::SetConsoleLogSeverity(logLevel); + if (vm.count("log-level")) { String severity = vm["log-level"].as(); diff --git a/lib/cli/CMakeLists.txt b/lib/cli/CMakeLists.txt index fd6006945..d16ec9d5b 100644 --- a/lib/cli/CMakeLists.txt +++ b/lib/cli/CMakeLists.txt @@ -34,7 +34,7 @@ endif() add_library(cli SHARED ${cli_SOURCES}) -target_link_libraries(cli ${Boost_LIBRARIES} base config remote icinga) +target_link_libraries(cli ${Boost_LIBRARIES} base config remote) set_target_properties ( cli PROPERTIES diff --git a/lib/cli/repositoryobjectcommand.cpp b/lib/cli/repositoryobjectcommand.cpp index 22a328a21..cddbc7c40 100644 --- a/lib/cli/repositoryobjectcommand.cpp +++ b/lib/cli/repositoryobjectcommand.cpp @@ -21,6 +21,7 @@ #include "cli/repositoryutility.hpp" #include "base/logger.hpp" #include "base/application.hpp" +#include "base/utility.hpp" #include #include #include @@ -125,6 +126,7 @@ void RepositoryObjectCommand::InitParameters(boost::program_options::options_des std::vector RepositoryObjectCommand::GetPositionalSuggestions(const String& word) const { if (m_Command == RepositoryCommandAdd) { + Utility::LoadExtensionLibrary("icinga"); const Type *ptype = Type::GetByName(m_Type); ASSERT(ptype); return GetFieldCompletionSuggestions(ptype, word);