diff --git a/build.zig b/build.zig index acfa30a..1dc75df 100644 --- a/build.zig +++ b/build.zig @@ -1,4 +1,5 @@ const std = @import("std"); +const zzdoc = @import("zzdoc"); /// Must be kept in sync with git tags const version: std.SemanticVersion = .{ .major = 0, .minor = 1, .patch = 0 }; @@ -7,6 +8,16 @@ pub fn build(b: *std.Build) void { const target = b.standardTargetOptions(.{}); const optimize = b.standardOptimizeOption(.{}); + // manpages + { + var man_step = zzdoc.addManpageStep(b, .{ + .root_doc_dir = b.path("docs/"), + }); + + const install_step = man_step.addInstallStep(.{}); + b.default_step.dependOn(&install_step.step); + } + const exe_mod = b.createModule(.{ .root_source_file = b.path("src/main.zig"), .target = target, diff --git a/build.zig.zon b/build.zig.zon index 9559aa0..73b427d 100644 --- a/build.zig.zon +++ b/build.zig.zon @@ -14,6 +14,10 @@ .url = "git+https://github.com/rockorager/zeit#4496d1c40b2223c22a1341e175fc2ecd94cc0de9", .hash = "zeit-0.6.0-5I6bk1J1AgA13rteb6E0steXiOUKBYTzJZMMIuK9oEmb", }, + .zzdoc = .{ + .url = "git+https://github.com/rockorager/zzdoc#57e86eb4e621bc4a96fbe0dd89ad0986db6d0483", + .hash = "zzdoc-0.0.0-tzT1PuPZAACr1jIJxjTrdOsLbfXS6idWFGfTq0gwxJiv", + }, }, .paths = .{ "build.zig", diff --git a/docs/lsr.1.scd b/docs/lsr.1.scd new file mode 100644 index 0000000..9c84b8e --- /dev/null +++ b/docs/lsr.1.scd @@ -0,0 +1,42 @@ +lsr(1) + +# NAME + +lsr - list directory contents, but with io_uring + +# SYNOPSIS + +*lsr* [options...] [directory] + +# DESCRIPTION + +lsr is an implementation of ls(1) which utilizes io_uring to perform syscall +batching. + +# OPTIONS + +*-1*, *--oneline* + Print entries one per line +*-a*, *--all* + Show files that start with a dot (ASCII 0x2E) +*-A*, *--almost-all* + Like --all, but skips implicit "." and ".." directories +*-C*, *--columns* + Print the output in columns +*--color=WHEN* + When to use colors (always, auto, never) +*--group-directories-first* + When to use colors (always, auto, never) +*--help* + Print the version and exit. +*--icons=WHEN* + When to display icons (always, auto, never) +*-l*, *--long* + Display extended file metadata +*--version* + Print the version and exit. + +# AUTHORS + +Written and maintained by Tim Culverhouse , assisted by +open source contributors. diff --git a/src/main.zig b/src/main.zig index 44694d1..0d556de 100644 --- a/src/main.zig +++ b/src/main.zig @@ -11,6 +11,7 @@ const usage = \\ lsr [options] [directory] \\ \\ --help Print this message and exit + \\ --version Print the version string \\ \\DISPLAY OPTIONS \\ -1, --oneline Print entries one per line