github muhammad-fiaz/args.zig 0.0.3
V0.0.3

latest releases: 0.0.9, 0.0.8, 0.0.7...
9 months ago

📃 Documentation

Full Documentation can be found at https://muhammad-fiaz.github.io/args.zig/

📦 Installation

Option A — Automatic (Recommended)

Run this to install the dependency and automatically save the hash:

zig fetch --save https://github.com/muhammad-fiaz/args.zig/archive/refs/tags/0.0.3.tar.gz

Note

After running, Zig updates your build.zig.zon with the correct hash automatically.

The entry will look like:

.dependencies = .{
    .args = .{
        .url = "https://github.com/muhammad-fiaz/args.zig/archive/refs/tags/0.0.3.tar.gz",
        .hash = "args-0.0.3-8hzgbnU9AwAj9fDwswfT_eY29UQA0-uTjYdbCEWojo3Z",
    },
},

Option B — Manual

zig fetch --hash https://github.com/muhammad-fiaz/args.zig/archive/refs/tags/0.0.3.tar.gz

Copy that hash into your build.zig.zon:

.hash = "args-0.0.3-8hzgbnU9AwAj9fDwswfT_eY29UQA0-uTjYdbCEWojo3Z"

📊 Benchmarks

The following benchmark results were captured during the release workflow:

Note

Benchmarks are automatically generated by GitHub Actions using bench/benchmark.zig. Results may vary based on the CI runner environment.

📊 ARGS.ZIG BENCHMARK RESULTS

Environment Details:

  • Platform: linux
  • Architecture: x86_64
  • Warmup Iterations: 100
  • Benchmark Iterations: 10000
Basic Parsing
Benchmark Ops/sec (higher is better) Avg Latency (ns) (lower is better)
Simple Flags (3 flags) 10946 91356
Multiple Options (3 options) 9896 101046
Positional Arguments (3 positionals) 14465 69130
Counters (-vvv -dd) 16649 60064
Advanced Features
Benchmark Ops/sec (higher is better) Avg Latency (ns) (lower is better)
Subcommands (2 subcommands) 16780 59595
Mixed Arguments (complex CLI) 9390 106501
Argument Groups 15365 65082
Callbacks 15225 65680
Expect Validation 20846 47970
Declarative Structs 12325 81134
Generation
Benchmark Ops/sec (higher is better) Avg Latency (ns) (lower is better)
Help Text Generation 7787 128412
Shell Completion Generation (Bash) 15364 65088

📈 Benchmark Summary

  • Total benchmarks run: 12
  • Average throughput: 13753 ops/sec
  • Maximum throughput: 20846 ops/sec (Expect Validation)
  • Minimum throughput: 7787 ops/sec (Help Text Generation)
  • Average latency: 72710 ns

⬇️ Downloads (Prebuilt Library)

Platform Architecture File
Windows x86_64 args-x86_64-windows.lib
Windows x86 args-x86-windows.lib
Linux x86_64 libargs-x86_64-linux.a
Linux x86 libargs-x86-linux.a
Linux aarch64 (ARM64) libargs-aarch64-linux.a
macOS x86_64 (Intel) libargs-x86_64-macos.a
macOS aarch64 (Apple Silicon) libargs-aarch64-macos.a
Bare Metal x86_64 libargs-x86_64-freestanding.a
Bare Metal aarch64 libargs-aarch64-freestanding.a
Bare Metal RISC-V 64 libargs-riscv64-freestanding.a
Bare Metal ARM libargs-arm-freestanding.a

🛠️ Using Prebuilt Libraries

  1. Download the library for your platform.
  2. Place it in your project (e.g., in a libs/ folder).
  3. Update your build.zig:
// Assuming you placed the library in `libs/`
exe.addLibraryPath(b.path("libs"));
exe.linkSystemLibrary("args");

Don't miss a new args.zig release

NewReleases is sending notifications on new releases.