This repository was archived by the owner on Nov 22, 2026. It is now read-only.
Repository navigation
mojo-args v0.1.0
mojo-args v0.1.0
Released: 2026-10-21 · Commit: 7353d4b · Previous: first release
What it does
Command-line parsing for Mojo with Python argparse's behaviour: sub-commands, typed and repeatable options, a remainder command, prefix abbreviation, and argparse's own usage-error messages.
Highlights
- Same parse results and the same usage-error text as Python argparse on 75 argv cases, 34 of them errors.
- argparse's quirks included: unique-prefix abbreviation, ambiguous-prefix errors,
--kept by a remainder,--opt=value, bundled short flags. - 13x faster than argparse: 200k parses in 252 to 259 ms vs 3,346 to 3,367 ms; building a parser takes 0.05 ms vs 11.3 ms.
Changes
First public release, no earlier version.
Verified
| Check | Result |
|---|---|
scripts/check.sh: 75 argv cases vs Python 3.14 argparse, plus api test, example and a real process (exit 2, stderr) |
PASS all |
scripts/ci.sh on a pristine Ubuntu 24.04.5 VM (installs CPython 3.14.8) |
PASS all |
| two mutants (a changed message, a broken remainder) | both fail the gate |
Known limits
--helpoutput is simple and not checked against argparse.- A sub-command usage error prints the top-level usage line, where argparse prints the sub-command's.
- Integers are Int64, ASCII digits only.
Upgrade / run
git clone https://github.com/amarbaro/mojo-args && cd mojo-args && uv sync
mojo run -I src examples/quickstart.mojo
Commits
7353d4bbuild: uv.lock (mojo 1.1.0)91a4661ci(args): GitHub Actions runs scripts/ci.sh with Python 3.14 as the oracle7f610fedocs(args): README with numbers and limits, api.md, design.md, agent skill2198e6ebench(args): 200k parses of the gpu-wait parser, 13x faster than argparseeeed809feat(args): argparse-compatible parser for Mojo, 75 cases identical to Pythoncfc3708test(args): argparse oracle on gpu-wait's parser shape, 23 argv cases1df9997chore: repo layout, Apache-2.0, mojo>=1.1