]> granicus.if.org Git - icinga2/blob - lib/cli/featureenablecommand.cpp
add some object locking to the Dump method (which could theoreticylly suffer from...
[icinga2] / lib / cli / featureenablecommand.cpp
1 /* Icinga 2 | (c) 2012 Icinga GmbH | GPLv2+ */
2
3 #include "cli/featureenablecommand.hpp"
4 #include "cli/featureutility.hpp"
5 #include "base/logger.hpp"
6
7 using namespace icinga;
8 namespace po = boost::program_options;
9
10 REGISTER_CLICOMMAND("feature/enable", FeatureEnableCommand);
11
12 String FeatureEnableCommand::GetDescription() const
13 {
14         return "Enables specified Icinga 2 feature.";
15 }
16
17 String FeatureEnableCommand::GetShortDescription() const
18 {
19         return "enables specified feature";
20 }
21
22 std::vector<String> FeatureEnableCommand::GetPositionalSuggestions(const String& word) const
23 {
24         return FeatureUtility::GetFieldCompletionSuggestions(word, true);
25 }
26
27 int FeatureEnableCommand::GetMinArguments() const
28 {
29         return 1;
30 }
31
32 int FeatureEnableCommand::GetMaxArguments() const
33 {
34         return -1;
35 }
36
37 ImpersonationLevel FeatureEnableCommand::GetImpersonationLevel() const
38 {
39         return ImpersonateIcinga;
40 }
41
42 /**
43  * The entry point for the "feature enable" CLI command.
44  *
45  * @returns An exit status.
46  */
47 int FeatureEnableCommand::Run(const boost::program_options::variables_map& vm, const std::vector<std::string>& ap) const
48 {
49         return FeatureUtility::EnableFeatures(ap);
50 }