2 // Copyright © 2020 Arm Ltd. All rights reserved.
3 // SPDX-License-Identifier: MIT
8 #include <cxxopts/cxxopts.hpp>
11 * Ensure all mandatory command-line parameters have been passed to cxxopts.
12 * @param result returned from the cxxopts parse(argc, argv) call
13 * @param required vector of strings listing the mandatory parameters to be input from the command-line
14 * @return boolean value - true if all required parameters satisfied, false otherwise
16 inline bool CheckRequiredOptions(const cxxopts::ParseResult& result, const std::vector<std::string>& required)
18 for(const std::string& str : required)
20 if(result.count(str) == 0)
22 std::cerr << "--" << str << " parameter is mandatory" << std::endl;