larzargs
Simple command-line argument parsing, no ceremony.
The unambiguous --name=value form for flags with values, a bare --name or -x for boolean flags, everything else collected as positional args. -abc expands to three separate boolean flags, matching the getopt convention scripts expect.
larzscript pkg install args
What you get
- --name=value for flags with values
- Bare --name/-x for boolean flags
- -abc expands to 3 boolean flags
- flag() with a default for anything unset
Try it
import "args" as args let p = args.parse(["--name=Ada", "--verbose", "run.txt"]) print(p["flags"]["name"], p["flags"]["verbose"], p["positional"]) print(args.flag(p, "missing", "default-val"))
Output
Ada true [run.txt] default-val
Why it's in the Larz Stack
larzargs is a real Larzscript package (larzscript pkg install args) - money-native, zero dependencies, the same language as the rest of the estate, not a separate Python runtime. It composes with the rest of the Larz Stack and the Larz framework.