You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

21 lines
649 B

  1. #include <iostream>
  2. #include <gflags/gflags.h>
  3. //#include <logging.h>
  4. DEFINE_string(input, "", "Input file to process.");
  5. DEFINE_int32(num_threads, 1, "Number of threads to use.");
  6. int main(int argc, char* argv[]) {
  7. // 初始化gflags库
  8. gflags::ParseCommandLineFlags(&argc, &argv, true);
  9. // 检查是否提供了输入文件
  10. if (FLAGS_input.empty()) {
  11. std::cerr << "Error: Input file not specified." << std::endl;
  12. return 1;
  13. }
  14. // 输出解析到的参数
  15. std::cout << "Input file: " << FLAGS_input << std::endl;
  16. std::cout << "Number of threads: " << FLAGS_num_threads << std::endl;
  17. return 0;
  18. }