命令行參數解析工具:ccflag
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);</pre>
本文由用戶 xm52 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!