blob: 8935568b5760e56405cc1d84706e74a91953f630 [file] [log] [blame]
#include <iostream>
#include <phosphor-logging/log.hpp>
#include "argument.hpp"
#include "gpio_presence.hpp"
using namespace phosphor::logging;
using namespace phosphor::gpio;
using namespace phosphor::gpio::presence;
int main(int argc, char* argv[])
{
auto options = ArgumentParser(argc, argv);
auto inventory = options["inventory"];
auto key = options["key"];
auto path = options["path"];
if (argc < 4)
{
std::cerr << "Too few arguments\n";
options.usage(argv);
}
if (inventory == ArgumentParser::emptyString)
{
std::cerr << "Inventory argument required\n";
options.usage(argv);
}
if (key == ArgumentParser::emptyString)
{
std::cerr << "GPIO key argument required\n";
options.usage(argv);
}
if (path == ArgumentParser::emptyString)
{
std::cerr << "Device path argument required\n";
options.usage(argv);
}
Presence presence(inventory, path, std::stoul(key), options["name"]);
return 0;
}