wrapc
A zero-fuss, type-safe parser for
rustcarguments, designed forRUSTC_WRAPPERtools.
wrapc parses rustc's notoriously complex CLI into strongly-typed Rust structs — with flawless round-trip reconstruction via Info::to_args().
Why not clap?
rustc's argument surface is unique:
- Mixed
=and space-separated values (--edition=2021vs-L native=/path) - Complex sub-syntaxes (
-l static:+bundle,+whole-archive=foo:bar) - Nightly flags that appear/disappear without notice
- The
RUSTC_WRAPPERprotocol:<wrapper> - <rustc> <args...>
clap is too rigid for this. wrapc is purpose-built.
Quick Start
Add to your dependencies:
cargo add wrapc
Canonical wrapper skeleton:
use Command;
use fetch;
Documentation
Full API reference, protocol details, and advanced usage patterns are available in the book.
License
MIT OR Apache-2.0