8 #include <cxxopts/cxxopts.hpp> 18 cxxopts::Options options(
"GatordMock",
19 "Simulate a Gatord server to interact with ArmNN external profiling.");
24 (
"h,help",
"Display help messages")
26 "The path to the file that contains instructions for the mock gatord.",
27 cxxopts::value<std::string>(m_File))
29 "The Unix domain socket namespace this server will bind to.\n" 30 "This will always be prepended with \\0 to use the abstract namespace",
31 cxxopts::value<std::string>(m_UdsNamespace)->default_value(
"gatord_namespace"))
33 "Echo packets sent and received to stdout. Disabled by default. " 34 "Default value = false.",
35 cxxopts::value<bool>(m_Echo)->default_value(
"false"));
37 catch (
const std::exception& e)
39 std::cerr <<
"Fatal internal error: [" << e.what() <<
"]" << std::endl;
45 auto result = options.parse(argc, argv);
47 if (result.count(
"help"))
49 std::cout << options.help() << std::endl;
54 if (!result.count(
"file"))
56 std::cout <<
"-f/--file parameter is mandatory." << std::endl;
61 if (result.count(
"echo"))
66 catch (
const cxxopts::OptionException& e)
68 std::cerr << e.what() << std::endl;
bool ProcessCommandLine(int argc, char *argv[])
Copyright (c) 2021 ARM Limited and Contributors.