Gunnar Mills | 7263915 | 2017-06-22 15:06:21 -0500 | [diff] [blame^] | 1 | #include <iostream> |
| 2 | #include <phosphor-logging/log.hpp> |
| 3 | #include "argument.hpp" |
| 4 | #include "gpio_presence.hpp" |
| 5 | |
| 6 | using namespace phosphor::logging; |
| 7 | using namespace phosphor::gpio; |
| 8 | |
| 9 | int main(int argc, char* argv[]) |
| 10 | { |
| 11 | auto options = ArgumentParser(argc, argv); |
| 12 | |
| 13 | auto inventory = options["inventory"]; |
| 14 | auto key = options["key"]; |
| 15 | auto path = options["path"]; |
| 16 | if (argc < 4) |
| 17 | { |
| 18 | std::cerr << "Too few arguments\n"; |
| 19 | options.usage(argv); |
| 20 | } |
| 21 | |
| 22 | if (inventory == ArgumentParser::emptyString) |
| 23 | { |
| 24 | std::cerr << "Inventory argument required\n"; |
| 25 | options.usage(argv); |
| 26 | } |
| 27 | |
| 28 | if (key == ArgumentParser::emptyString) |
| 29 | { |
| 30 | std::cerr << "GPIO key argument required\n"; |
| 31 | options.usage(argv); |
| 32 | } |
| 33 | |
| 34 | if (path == ArgumentParser::emptyString) |
| 35 | { |
| 36 | std::cerr << "Device path argument required\n"; |
| 37 | options.usage(argv); |
| 38 | } |
| 39 | |
| 40 | return 0; |
| 41 | } |
| 42 | |