mcpp index

mcpplibs.cmdline

import

A simple command-line parsing library/framework for modern C++

import mcpplibs.cmdline;
mcpp add mcpplibs.cmdline@0.0.2

用法

來自本倉庫自己的測試專案 —— CI 真的編譯並執行過,不是為了網站寫的。

// Consuming `mcpplibs.cmdline` through the published index.
//
// `parse_from` rather than `run(argc, argv)`: a test whose only assertion is
// "it linked" passes for a package that parses nothing. Parsing a string and
// checking what came out is the difference between testing the dependency
// edge and testing the dependency.
//
// The chains end in `.end()`, which is what commits the pending item and
// hands back the App — a builder is not an App, and the compiler says so.
import std;
import mcpplibs.cmdline;

using namespace mcpplibs;

int main() {
    int failures = 0;
    auto check = [&](bool ok, std::string_view what) {
        if (!ok) { std::println("FAIL: {}", what); ++failures; }
    };

    auto app = cmdline::App("tool")
        .version("1.0")
// …

tests/examples/cmdline/tests/consume.cpp · 專案 tests/examples/cmdline

建置

modules
mcpplibs.cmdline
targets
cmdline (lib)
language
c++23
import std
yes

原始檔 (1)

  • */src/**/*.cppm

版本

版本平台 鏡像sha256
0.0.2 最新 LinuxWindowsmacOS CN GLOBAL 4f3e2b8dc4d9…
0.0.1 LinuxWindowsmacOS CN GLOBAL 3fb2f5495c1a…