From ce6f7ace8951fabe1bfc59644931399af86dec19 Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Wed, 15 Oct 2014 08:45:58 +0200 Subject: [PATCH] Replace spaces with tabs refs #7250 --- lib/base/clicommand.hpp | 12 +++--- lib/cli/featuredisablecommand.cpp | 62 +++++++++++++++---------------- lib/cli/featureenablecommand.cpp | 2 +- lib/cli/featurelistcommand.cpp | 10 ++--- lib/cli/featurelistcommand.hpp | 2 +- 5 files changed, 44 insertions(+), 44 deletions(-) diff --git a/lib/base/clicommand.hpp b/lib/base/clicommand.hpp index 5abdea6bc..77af27105 100644 --- a/lib/base/clicommand.hpp +++ b/lib/base/clicommand.hpp @@ -56,14 +56,14 @@ public: static void Unregister(const std::vector& name); static bool ParseCommand(int argc, char **argv, boost::program_options::options_description& visibleDesc, - boost::program_options::options_description& hiddenDesc, - boost::program_options::positional_options_description& positionalDesc, - ArgumentCompletionDescription& argCompletionDesc, - boost::program_options::variables_map& vm, String& cmdname, - CLICommand::Ptr& command, bool autocomplete); + boost::program_options::options_description& hiddenDesc, + boost::program_options::positional_options_description& positionalDesc, + ArgumentCompletionDescription& argCompletionDesc, + boost::program_options::variables_map& vm, String& cmdname, + CLICommand::Ptr& command, bool autocomplete); static void ShowCommands(int argc, char **argv, - boost::program_options::options_description *visibleDesc = NULL, + boost::program_options::options_description *visibleDesc = NULL, boost::program_options::options_description *hiddenDesc = NULL, ArgumentCompletionDescription *argCompletionDesc = NULL, bool autocomplete = false, int autoindex = -1); diff --git a/lib/cli/featuredisablecommand.cpp b/lib/cli/featuredisablecommand.cpp index 1dbc6dbbf..530ed21e7 100644 --- a/lib/cli/featuredisablecommand.cpp +++ b/lib/cli/featuredisablecommand.cpp @@ -48,7 +48,7 @@ void FeatureDisableCommand::InitParameters(boost::program_options::options_descr boost::program_options::options_description& hiddenDesc, ArgumentCompletionDescription& argCompletionDesc) const { - /* Command doesn't support any parameters. */ + /* Command doesn't support any parameters. */ } /** @@ -60,46 +60,46 @@ int FeatureDisableCommand::Run(const boost::program_options::variables_map& vm, { #ifdef _WIN32 //TODO: Add Windows support - Log(LogInformation, "cli", "This command is not available on Windows."); + Log(LogInformation, "cli", "This command is not available on Windows."); #else - String features_enabled_dir = Application::GetSysconfDir() + "/icinga2/features-enabled"; + String features_enabled_dir = Application::GetSysconfDir() + "/icinga2/features-enabled"; - if (ap.empty()) { - Log(LogCritical, "cli", "Cannot disable feature(s). Name(s) are missing!"); - return 0; - } + if (ap.empty()) { + Log(LogCritical, "cli", "Cannot disable feature(s). Name(s) are missing!"); + return 0; + } - if (!Utility::PathExists(features_enabled_dir) ) { - Log(LogCritical, "cli", "Cannot disable features. Path '" + features_enabled_dir + "' does not exist."); - return 0; - } + if (!Utility::PathExists(features_enabled_dir) ) { + Log(LogCritical, "cli", "Cannot disable features. Path '" + features_enabled_dir + "' does not exist."); + return 0; + } - std::vector errors; + std::vector errors; - BOOST_FOREACH(const String& feature, ap) { - String target = features_enabled_dir + "/" + feature + ".conf"; + BOOST_FOREACH(const String& feature, ap) { + String target = features_enabled_dir + "/" + feature + ".conf"; - if (!Utility::PathExists(target) ) { - Log(LogCritical, "cli", "Cannot disable feature '" + feature + "'. Target file '" + target + "' does not exist."); - errors.push_back(feature); - continue; - } - - if (unlink(target.CStr()) < 0) { - Log(LogCritical, "cli", "Cannot disable feature '" + feature + "'. Unlinking target file '" + target + - "' failed with error code " + Convert::ToString(errno) + ", \"" + Utility::FormatErrorNumber(errno) + "\"."); - errors.push_back(feature); - continue; + if (!Utility::PathExists(target) ) { + Log(LogCritical, "cli", "Cannot disable feature '" + feature + "'. Target file '" + target + "' does not exist."); + errors.push_back(feature); + continue; } - Log(LogInformation, "cli", "Disabling feature " + feature + " in '" + features_enabled_dir + "'."); - } + if (unlink(target.CStr()) < 0) { + Log(LogCritical, "cli", "Cannot disable feature '" + feature + "'. Unlinking target file '" + target + + "' failed with error code " + Convert::ToString(errno) + ", \"" + Utility::FormatErrorNumber(errno) + "\"."); + errors.push_back(feature); + continue; + } - if (!errors.empty()) { - Log(LogCritical, "cli", "Cannot disable feature(s): " + boost::algorithm::join(errors, " ")); + Log(LogInformation, "cli", "Disabling feature " + feature + " in '" + features_enabled_dir + "'."); + } + + if (!errors.empty()) { + Log(LogCritical, "cli", "Cannot disable feature(s): " + boost::algorithm::join(errors, " ")); errors.clear(); - return 1; - } + return 1; + } #endif /* _WIN32 */ diff --git a/lib/cli/featureenablecommand.cpp b/lib/cli/featureenablecommand.cpp index 3c318b1d9..c5f357e90 100644 --- a/lib/cli/featureenablecommand.cpp +++ b/lib/cli/featureenablecommand.cpp @@ -48,7 +48,7 @@ void FeatureEnableCommand::InitParameters(boost::program_options::options_descri boost::program_options::options_description& hiddenDesc, ArgumentCompletionDescription& argCompletionDesc) const { - /* Command doesn't support any parameters. */ + /* Command doesn't support any parameters. */ } /** diff --git a/lib/cli/featurelistcommand.cpp b/lib/cli/featurelistcommand.cpp index eaa66ced2..ed40ddb85 100644 --- a/lib/cli/featurelistcommand.cpp +++ b/lib/cli/featurelistcommand.cpp @@ -48,7 +48,7 @@ void FeatureListCommand::InitParameters(boost::program_options::options_descript boost::program_options::options_description& hiddenDesc, ArgumentCompletionDescription& argCompletionDesc) const { - /* Command doesn't support any parameters. */ + /* Command doesn't support any parameters. */ } /** @@ -58,13 +58,13 @@ void FeatureListCommand::InitParameters(boost::program_options::options_descript */ int FeatureListCommand::Run(const boost::program_options::variables_map& vm, const std::vector& ap) const { - if (!ap.empty()) { - Log(LogWarning, "cli", "Ignoring parameters: " + boost::algorithm::join(ap, " ")); - } + if (!ap.empty()) { + Log(LogWarning, "cli", "Ignoring parameters: " + boost::algorithm::join(ap, " ")); + } #ifdef _WIN32 //TODO: Add Windows support - Log(LogInformation, "cli", "This command is not available on Windows."); + Log(LogInformation, "cli", "This command is not available on Windows."); #else std::vector enabled_features; std::vector available_features; diff --git a/lib/cli/featurelistcommand.hpp b/lib/cli/featurelistcommand.hpp index 350bca2a6..272b0d0ed 100644 --- a/lib/cli/featurelistcommand.hpp +++ b/lib/cli/featurelistcommand.hpp @@ -44,7 +44,7 @@ public: virtual int Run(const boost::program_options::variables_map& vm, const std::vector& ap) const; private: - static void CollectFeatures(const String& feature_file, std::vector& features); + static void CollectFeatures(const String& feature_file, std::vector& features); };