aboutsummaryrefslogtreecommitdiff
path: root/build.zig
diff options
context:
space:
mode:
authornovakne <hmachet@zoho.com>2021-03-13 17:06:39 +0100
committerIsaac Freund <ifreund@ifreund.xyz>2021-03-14 17:31:59 +0100
commitc9a4dde331b815c85cc3cc38125bd61645fea53b (patch)
tree90750a030be18bb534d8afd0ddc81991de03bc43 /build.zig
parenteb1dd401f894199d7e9ddaec15da1c7635402eaf (diff)
downloadriver-c9a4dde331b815c85cc3cc38125bd61645fea53b.tar.gz
river-c9a4dde331b815c85cc3cc38125bd61645fea53b.tar.xz
completions: add zsh completion for riverctl
Diffstat (limited to 'build.zig')
-rw-r--r--build.zig13
1 files changed, 13 insertions, 0 deletions
diff --git a/build.zig b/build.zig
index abf7f6b..3ea4ff6 100644
--- a/build.zig
+++ b/build.zig
@@ -31,6 +31,12 @@ pub fn build(b: *zbs.Builder) !void {
"Set to true to install bash completion for riverctl. Defaults to true.",
) orelse true;
+ const zsh_completion = b.option(
+ bool,
+ "zsh-completion",
+ "Set to true to install zsh completion for riverctl. Defaults to true.",
+ ) orelse true;
+
const examples = b.option(bool, "examples", "Set to true to build examples") orelse false;
const resolved_prefix = try std.fs.path.resolve(b.allocator, &[_][]const u8{b.install_prefix.?});
@@ -101,6 +107,13 @@ pub fn build(b: *zbs.Builder) !void {
);
}
+ if (zsh_completion) {
+ b.installFile(
+ "completions/zsh/_riverctl",
+ "share/zsh/site-functions/_riverctl",
+ );
+ }
+
if (examples) {
inline for (.{ "status", "options" }) |example_name| {
const example = b.addExecutable(example_name, "example/" ++ example_name ++ ".zig");