cxxopts is a lightweight, header-only C++11 library for parsing command line options in GNU style. It provides a fluent API to define options with short and long names, positional arguments, default/implicit values, and supports boolean, integer, floating-point, string, vector, optional, and filesystem types. The parser handles GNU-style syntax (e.g., --long, -a, --long=value, combined short options) and produces a ParseResult object for querying parsed values, unmatched arguments, and iteration. The library is self-contained in a single header file (include/cxxopts.hpp) and requires no external dependencies beyond the C++ standard library, with optional Unicode support via ICU. The code demonstrates careful attention to integer overflow detection, locale-independent parsing, and robust help text wrapping. It is widely used in the C++ ecosystem, with active maintenance, fuzzing, and comprehensive test coverage.
Argh is an opinionated derive-based argument parsing library for Rust, optimized for code size and conformance to Fuchsia CLI specifications. The repository is a multi-crate workspace: `argh` (public API, re-exports derive macros and provides runtime functions like `from_env`), `argh_derive` (proc-macro implementation of `FromArgs`, `FromArgValue`, and `ArgsInfo`), `argh_shared` (shared data structures for command metadata, used by both derive and completion crates), and `argh_complete` (generators for bash, zsh, fish, and nushell shell completions). The core architecture uses a derive macro to generate parsing code at compile time, producing minimal binary size. It supports switches, options (required, optional, repeating), positional arguments (including greedy/remainder), subcommands (static and dynamic), custom parsers via `FromArgValue`, default values, and extensive help/usage formatting with notes, examples, and error codes. The library is well-tested with unit tests, compile-fail UI tests, and integration tests. It is designed as a lightweight alternative to clap, prioritizing code size and compile-time speed.