mcpplibs.cmdline
importA simple command-line parsing library/framework for modern C++
import mcpplibs.cmdline;
Module name read from the upstream `export module` declaration in src/cmdline.cppm.
mcpp add mcpplibs.cmdline@0.1.0
Usage
From this repository's own test project — built and run by CI, not written for the website.
// 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 · project tests/examples/cmdline
openkal
| target | result | environment | test project | first diagnostic |
|---|---|---|---|---|
| aarch64-linux-musl | runs | posix | cmdline | |
| x86_64-linux-gnu | runs | posix | cmdline | |
| x86_64-linux-musl | runs | posix | cmdline | |
| x86_64-windows-musl | fails | cmdline | error: openkal-llvm-runtime is requested as '0.15.2' by cmdline-tests, and the platform openkal-platform 0.32.1 is a version group |
How this was measured
Measured 2026-11-29 by tests/openkal/compat.py with openkal-llvm-runtime 0.15.2, llvm@22.1.8, mcpp 2026.11.23.1. The test project selects no platform dependency of its own. The badge above is a summary of the strictest measured target -- the table above states each target's own environment.
Build · upstream manifest
- modules
mcpplibs.cmdline- targets
cmdline (lib)- manifest version
0.1.0- source
https://raw.githubusercontent.com/mcpplibs/cmdline/v0.1.0/mcpp.toml