<kbd id="afajh"><form id="afajh"></form></kbd>
<strong id="afajh"><dl id="afajh"></dl></strong>
    <del id="afajh"><form id="afajh"></form></del>
        1. <th id="afajh"><progress id="afajh"></progress></th>
          <b id="afajh"><abbr id="afajh"></abbr></b>
          <th id="afajh"><progress id="afajh"></progress></th>

          clippC++ 命令行界面

          聯(lián)合創(chuàng)作 · 2023-09-30 20:25

          clipp 是一個現(xiàn)代 C++ 的命令行界面。它易于使用,功能強大,支持 C++ 11/14/17,且項目僅集成在單個頭文件中的。

          功能支持選項、選項+值、文檔路徑值、位置命令、嵌套替代、決策樹、可連接標志、自定義值過濾等,此外還有文檔生成(使用行、手冊頁)與錯誤處理。

          簡單使用示例:

          以這個命令行界面為例:

          SYNOPSIS
              convert <input file> [-r] [-o <output format>] [-utf16]
          
          OPTIONS
              -r, --recursive  convert files recursively
              -utf16           use UTF-16 encoding

          代碼定義了 input file 和三個選項:-r、-o 和 -utf16。如果解析失敗,默認使用文檔頁代碼片段將打印到 stdout。

          #include <iostream>
          #include "clipp.h"
          using namespace clipp; using std::cout; using std::string;
          
          int main(int argc, char* argv[]) { 
              bool rec = false, utf16 = false;
              string infile = "", fmt = "csv";
          
              auto cli = (
                  value("input file", infile),
                  option("-r", "--recursive").set(rec).doc("convert files recursively"),
                  option("-o") & value("output format", fmt),
                  option("-utf16").set(utf16).doc("use UTF-16 encoding")
              );
          
              if(!parse(argc, argv, cli)) cout << make_man_page(cli, argv[0]);
              // ...
          }
          瀏覽 24
          點贊
          評論
          收藏
          分享

          手機掃一掃分享

          編輯 分享
          舉報
          評論
          圖片
          表情
          推薦
          點贊
          評論
          收藏
          分享

          手機掃一掃分享

          編輯 分享
          舉報
          <kbd id="afajh"><form id="afajh"></form></kbd>
          <strong id="afajh"><dl id="afajh"></dl></strong>
            <del id="afajh"><form id="afajh"></form></del>
                1. <th id="afajh"><progress id="afajh"></progress></th>
                  <b id="afajh"><abbr id="afajh"></abbr></b>
                  <th id="afajh"><progress id="afajh"></progress></th>
                  色玖玖 插person | 日本熟妇一区 | av电影天堂网 | 青青草男人的天堂黄上网站免费在线观看 | 樱桃香蕉视频 |