diff options
author | Brandon Wyman <bjwyman@gmail.com> | 2017-03-31 18:13:21 -0500 |
---|---|---|
committer | Patrick Williams <patrick@stwcx.xyz> | 2017-05-19 16:19:06 +0000 |
commit | fef0295a8d87754e491dcf133ea927b5c4d56303 (patch) | |
tree | 625df8225e8d9681ff1b5f9afb77104c9e899946 /cooling-type/argument.hpp | |
parent | af5d4c5ec0e07ba7a87ddff3f2066d9b3cbb52f8 (diff) | |
download | phosphor-fan-presence-fef0295a8d87754e491dcf133ea927b5c4d56303.tar.gz phosphor-fan-presence-fef0295a8d87754e491dcf133ea927b5c4d56303.zip |
Fill in shell functions/files for cooling type.
Change-Id: I8d18d3141e955adeffdd8122ebb17549c88edd77
Signed-off-by: Brandon Wyman <bjwyman@gmail.com>
Diffstat (limited to 'cooling-type/argument.hpp')
-rw-r--r-- | cooling-type/argument.hpp | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/cooling-type/argument.hpp b/cooling-type/argument.hpp new file mode 100644 index 0000000..cc64891 --- /dev/null +++ b/cooling-type/argument.hpp @@ -0,0 +1,41 @@ +#pragma once + +#include <getopt.h> +#include <map> +#include <string> + +namespace phosphor +{ +namespace cooling +{ +namespace type +{ + +class ArgumentParser +{ + public: + ArgumentParser(int argc, char** argv); + ArgumentParser() = delete; + ArgumentParser(const ArgumentParser&) = delete; + ArgumentParser(ArgumentParser&&) = default; + ArgumentParser& operator=(const ArgumentParser&) = delete; + ArgumentParser& operator=(ArgumentParser&&) = default; + ~ArgumentParser() = default; + const std::string& operator[](const std::string& opt); + + static void usage(char** argv); + + static constexpr auto true_string = "true"; + static const std::string empty_string; + + private: + std::map<const std::string, std::string> arguments; + + static const option options[]; + static const char* optionstr; +}; + +} +} +} +// vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4 |