ArmNN
 21.11
CxxoptsUtils.hpp File Reference
#include <cxxopts/cxxopts.hpp>

Go to the source code of this file.

Functions

bool CheckRequiredOptions (const cxxopts::ParseResult &result, const std::vector< std::string > &required)
 Ensure all mandatory command-line parameters have been passed to cxxopts. More...
 

Function Documentation

◆ CheckRequiredOptions()

bool CheckRequiredOptions ( const cxxopts::ParseResult &  result,
const std::vector< std::string > &  required 
)
inline

Ensure all mandatory command-line parameters have been passed to cxxopts.

Parameters
resultreturned from the cxxopts parse(argc, argv) call
requiredvector of strings listing the mandatory parameters to be input from the command-line
Returns
boolean value - true if all required parameters satisfied, false otherwise

Definition at line 16 of file CxxoptsUtils.hpp.

Referenced by armnn::test::ParseCommandLine().

17 {
18  for(const std::string& str : required)
19  {
20  if(result.count(str) == 0)
21  {
22  std::cerr << "--" << str << " parameter is mandatory" << std::endl;
23  return false;
24  }
25  }
26  return true;
27 }