From c41bf5b7fdf4599101fe31e7d2e998aebfca7f92 Mon Sep 17 00:00:00 2001 From: Andrew Jeffery Date: Fri, 25 May 2018 16:39:22 +0930 Subject: Add OpenBMC C++ clang-format file and format code Change-Id: Ib3a388bf5392159440682265b577fba023c3c3aa Signed-off-by: Andrew Jeffery --- argument.cpp | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) (limited to 'argument.cpp') diff --git a/argument.cpp b/argument.cpp index b70a0dd..fd0c50d 100644 --- a/argument.cpp +++ b/argument.cpp @@ -14,11 +14,12 @@ * limitations under the License. */ -#include -#include +#include "argument.hpp" + #include #include -#include "argument.hpp" +#include +#include namespace phosphor { @@ -29,17 +30,17 @@ const std::string ArgumentParser::true_string = "true"; const std::string ArgumentParser::empty_string = ""; const char* ArgumentParser::optionstr = "p:?h"; -const option ArgumentParser::options[] = -{ - { "path", required_argument, nullptr, 'p' }, - { "help", no_argument, nullptr, 'h' }, - { 0, 0, 0, 0}, +const option ArgumentParser::options[] = { + {"path", required_argument, nullptr, 'p'}, + {"help", no_argument, nullptr, 'h'}, + {0, 0, 0, 0}, }; ArgumentParser::ArgumentParser(int argc, char** argv) { int option = 0; - while(-1 != (option = getopt_long(argc, argv, optionstr, options, nullptr))) + while (-1 != + (option = getopt_long(argc, argv, optionstr, options, nullptr))) { if ((option == '?') || (option == 'h')) { @@ -48,7 +49,8 @@ ArgumentParser::ArgumentParser(int argc, char** argv) } auto i = &options[0]; - while ((i->val != option) && (i->val != 0)) ++i; + while ((i->val != option) && (i->val != 0)) + ++i; if (i->val) arguments[i->name] = (i->has_arg ? optarg : true_string); @@ -74,8 +76,7 @@ void ArgumentParser::usage(char** argv) std::cerr << "Options:" << std::endl; std::cerr << " --help Print this menu" << std::endl; std::cerr << " --path= absolute path of LED in sysfs; like"; - std::cerr << " /sys/class/leds/" - << std::endl; + std::cerr << " /sys/class/leds/" << std::endl; } } // namespace led } // namespace phosphor -- cgit v1.2.1