argparse v0.5.0 MIT 22.1k - 187

Composable command-line argument parser with Aura styling.

rnx add argparse

argparse

Composable command-line argument parsing with Aura-styled help output. Flags collect into an insertion-ordered map.

Flag collection

.rnx
import { Map } from "@std/collections";


let flags = new Map();
flags.set("verbose", 1);
flags.set("workers", 4);
print(flags.get("verbose"), flags.len());

Usage line

.rnx
fn usage(prog: String): Int {
    print(prog, "[--verbose] [--workers N]");
    return 0;
}


return usage("serve");