blob: 3c7c3cf6f6b204f07e659e1b6ffd69e217f673ff [file] [log] [blame]
Gunnar Mills72639152017-06-22 15:06:21 -05001#include <iostream>
2#include <phosphor-logging/log.hpp>
3#include "argument.hpp"
4#include "gpio_presence.hpp"
5
6using namespace phosphor::logging;
7using namespace phosphor::gpio;
8
9int 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