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
627 B

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