1 /******************************************************************************
3 * Copyright (C) 2012-2018 Icinga Development Team (https://icinga.com/) *
5 * This program is free software; you can redistribute it and/or *
6 * modify it under the terms of the GNU General Public License *
7 * as published by the Free Software Foundation; either version 2 *
8 * of the License, or (at your option) any later version. *
10 * This program is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13 * GNU General Public License for more details. *
15 * You should have received a copy of the GNU General Public License *
16 * along with this program; if not, write to the Free Software Foundation *
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. *
18 ******************************************************************************/
20 #include "cli/featureenablecommand.hpp"
21 #include "cli/featureutility.hpp"
22 #include "base/logger.hpp"
24 using namespace icinga;
25 namespace po = boost::program_options;
27 REGISTER_CLICOMMAND("feature/enable", FeatureEnableCommand);
29 String FeatureEnableCommand::GetDescription() const
31 return "Enables specified Icinga 2 feature.";
34 String FeatureEnableCommand::GetShortDescription() const
36 return "enables specified feature";
39 std::vector<String> FeatureEnableCommand::GetPositionalSuggestions(const String& word) const
41 return FeatureUtility::GetFieldCompletionSuggestions(word, true);
44 int FeatureEnableCommand::GetMinArguments() const
49 int FeatureEnableCommand::GetMaxArguments() const
54 ImpersonationLevel FeatureEnableCommand::GetImpersonationLevel() const
56 return ImpersonateRoot;
60 * The entry point for the "feature enable" CLI command.
62 * @returns An exit status.
64 int FeatureEnableCommand::Run(const boost::program_options::variables_map& vm, const std::vector<std::string>& ap) const
66 return FeatureUtility::EnableFeatures(ap);