【github】CLI11
一. 配置
1.在main函数中增加
#include "CLI11.hpp"
2.将 CLI11.hpp 添加到路径下
可以直接从这里下载https://download.csdn.net/download/weixin_50862344/87900168
二. 使用
app.add_option(“-f”, filename, “test”);只要不写-h都行哈哈哈
#include "CLI11.hpp"
#include <iostream>
int main(int argc, const char* argv[]) {
CLI::App app{
"App description"};
std::string filename = "default";
app.add_option("-f", filename, "test");
std::cout<< "1"<<std::endl;
CLI11_PARSE(app, argc, argv);
std::cout<< "filename"<<filename <<std::endl;
return 0;
}