ccflag命令行参数解析工具

联合创作 · 2023-09-30 22:50

ccflag 是比 Google GFlags 更简单易用的 C++ 命令行参数解析工具,代码简洁,仅一个.h文件与一个.cc文件,比 gflags 更方便。

// parse command line flags from <argc, argv>.  
// non-flag elements will be put into the vector, if v != NULL.  
void init_ccflag(int argc, char** argv, std::vector<std::string>* v = NULL);

// parse command line flags from a string.  
// non-flag elements will be put into the vector, if v != NULL.  
// <usage>  init_ccflag("-i=23 -s=\"hello world\" -t=hello_world");  
void init_ccflag(const std::string& args, std::vector<std::string>* v = NULL);

// parse command line flags from <argc, argv> first, and then from config file.  
void init_ccflag(int argc, char** argv, const std::string& config);


浏览 3
点赞
评论
收藏
分享

手机扫一扫分享

编辑
举报
评论
图片
表情
推荐
点赞
评论
收藏
分享

手机扫一扫分享

编辑
举报