Modules

Zig modules

Install

zigcli support package manager introduced in Zig 0.11.

1
zig fetch --save=zigcli https://github.com/jiacai2050/zigcli/archive/${COMMIT}.tar.gz

Replace ${COMMIT} with a real one, then in your build.zig, import the module like this:

1
2
3
4
5
const zigcli = b.dependency("zigcli", .{});

// Currently zigcli provide two modules.
exe.root_module.addImport("simargs", zigcli.module("simargs"));
exe.root_module.addImport("pretty-table", zigcli.module("pretty-table"));

Available modules


simargs

A simple, opinionated, struct-based argument parser in Zig, taking full advantage of comptime.

pretty-table

Print aligned and formatted tables

Last modified September 28, 2024: refactor zip file directory structure (9e01903)