riverctl: add fish completion
This commit is contained in:
committed by
Isaac Freund
parent
bd604b0f47
commit
8627a2feff
13
build.zig
13
build.zig
@ -37,6 +37,12 @@ pub fn build(b: *zbs.Builder) !void {
|
||||
"Set to true to install zsh completion for riverctl. Defaults to true.",
|
||||
) orelse true;
|
||||
|
||||
const fish_completion = b.option(
|
||||
bool,
|
||||
"fish-completion",
|
||||
"Set to true to install fish 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.?});
|
||||
@ -114,6 +120,13 @@ pub fn build(b: *zbs.Builder) !void {
|
||||
);
|
||||
}
|
||||
|
||||
if (fish_completion) {
|
||||
b.installFile(
|
||||
"completions/fish/riverctl.fish",
|
||||
"share/fish/vendor_completions.d/riverctl.fish",
|
||||
);
|
||||
}
|
||||
|
||||
if (examples) {
|
||||
inline for (.{ "status", "options" }) |example_name| {
|
||||
const example = b.addExecutable(example_name, "example/" ++ example_name ++ ".zig");
|
||||
|
Reference in New Issue
Block a user