# SysExits for Zig This library provides the [SysExit](https://man.openbsd.org/sysexits.3) constants from BSD sysexits.h ## Add to your project Add the package to your `build.zig.zon`: ```sh zig fetch --save git+https://tangled.org/@matrixfurry.com/sysexits ``` Import the package in your `build.zig`: ```zig const sysexits = b.dependency("sysexits", .{}).module("sysexits"); exe.root_module.addImport("sysexits", sysexits); ``` ## Usage Use the constants provided by this library: ```zig const sysexits = @import("sysexits"); pub fn main() !u8 { // Oh no, the command was used incorrectly! return sysexits.usage; // Yay, everything worked correctly! return sysexits.ok; } ``` Or with `std.process.exit()`: ```zig const std = @import("std"); const sysexits = @import("sysexits"); pub fn main() !void { // Oh no, the command was used incorrectly! std.process.exit(sysexits.usage); // Yay, everything worked correctly! std.process.exit(sysexits.ok); } ```