ccflag命令行參數(shù)解析工具
ccflag 是比 Google GFlags 更簡(jiǎn)單易用的 C++ 命令行參數(shù)解析工具,代碼簡(jiǎn)潔,僅一個(gè).h文件與一個(gè).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);
評(píng)論
圖片
表情
