Cli: Fix autocompletion on Debian

refs #7246
This commit is contained in:
Michael Friedrich 2014-10-27 14:13:55 +01:00
parent d9c8252f17
commit 4cf46de5ab
3 changed files with 5 additions and 3 deletions

View File

@ -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<std::string>();

View File

@ -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

View File

@ -21,6 +21,7 @@
#include "cli/repositoryutility.hpp"
#include "base/logger.hpp"
#include "base/application.hpp"
#include "base/utility.hpp"
#include <boost/foreach.hpp>
#include <boost/algorithm/string/join.hpp>
#include <boost/algorithm/string/case_conv.hpp>
@ -125,6 +126,7 @@ void RepositoryObjectCommand::InitParameters(boost::program_options::options_des
std::vector<String> 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);