diff options
author | Patrick Venture <venture@google.com> | 2018-10-16 17:18:43 -0700 |
---|---|---|
committer | Patrick Venture <venture@google.com> | 2018-10-17 10:50:20 -0700 |
commit | c9508db8d33f4394e7c632b2c5cd15febaa8bf5e (patch) | |
tree | b55c60c320363a9540da430725579910c43117fb /argument.cpp | |
parent | 0d963f5938e68e05389fb479370f5d5fe8626729 (diff) | |
download | ipmi-fru-parser-c9508db8d33f4394e7c632b2c5cd15febaa8bf5e.tar.gz ipmi-fru-parser-c9508db8d33f4394e7c632b2c5cd15febaa8bf5e.zip |
add clang-format
Add clang-format file.
Change-Id: Ib99bbeb0ec59b5befb742dec38286c24a7f842ea
Signed-off-by: Patrick Venture <venture@google.com>
Diffstat (limited to 'argument.cpp')
-rw-r--r-- | argument.cpp | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/argument.cpp b/argument.cpp index a988ca5..f46206a 100644 --- a/argument.cpp +++ b/argument.cpp @@ -1,13 +1,14 @@ -#include <iostream> -#include <iterator> +#include "argument.hpp" + #include <algorithm> #include <cassert> -#include "argument.hpp" +#include <iostream> +#include <iterator> ArgumentParser::ArgumentParser(int argc, char** argv) { int option = 0; - while(-1 != (option = getopt_long(argc, argv, optionstr, options, NULL))) + while (-1 != (option = getopt_long(argc, argv, optionstr, options, NULL))) { if ((option == '?') || (option == 'h')) { @@ -16,7 +17,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); @@ -41,19 +43,17 @@ void ArgumentParser::usage(char** argv) std::cerr << "Usage: " << argv[0] << " [options]" << std::endl; std::cerr << "Options:" << std::endl; std::cerr << " --eeprom=<eeprom file path> Absolute file name of eeprom" - << std::endl; + << std::endl; std::cerr << " --fruid=<FRU ID> valid fru id in integer" - << std::endl; - std::cerr << " --help display help" - << std::endl; + << std::endl; + std::cerr << " --help display help" << std::endl; } -const option ArgumentParser::options[] = -{ - { "eeprom", required_argument, NULL, 'e' }, - { "fruid", required_argument, NULL, 'f' }, - { "help", no_argument, NULL, 'h' }, - { 0, 0, 0, 0}, +const option ArgumentParser::options[] = { + {"eeprom", required_argument, NULL, 'e'}, + {"fruid", required_argument, NULL, 'f'}, + {"help", no_argument, NULL, 'h'}, + {0, 0, 0, 0}, }; const char* ArgumentParser::optionstr = "e:f:?h"; |