Something went wrong. Try again.
BSD Sysexits for Zig
zig sysexits library
Something went wrong. Try again.
Zig 98%
2%
Commits 13
docs: fix import instructions
Signed-off-by: @matrixfurry.com <did:plc:zmjoeu3stwcn44647rhxa44o>
docs: Fix import instructions
Signed-off-by: @matrixfurry.com <did:plc:zmjoeu3stwcn44647rhxa44o>
Add OpenSSH revoked keys file
Signed-off-by: @matrixfurry.com <did:plc:zmjoeu3stwcn44647rhxa44o>
README.md
SysExits for Zig #
This library provides the SysExit constants from BSD sysexits.h
Add to your project #
Add the package to your build.zig.zon:
zig fetch --save https://tangled.org/did:plc:ees4lejcv6zjj3lz3ctj3djs/archive/main
Import the package in your build.zig:
const sysexits = b.dependency("sysexits", .{}).module("sysexits");
exe.root_module.addImport("sysexits", sysexits);
Usage #
Use the constants provided by this library:
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():
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);
}