Add bash completion for riverctl
This commit is contained in:
committed by
Isaac Freund
parent
27cac16ced
commit
eb1dd401f8
13
build.zig
13
build.zig
@ -25,6 +25,12 @@ pub fn build(b: *zbs.Builder) !void {
|
||||
break :scdoc_found true;
|
||||
};
|
||||
|
||||
const bash_completion = b.option(
|
||||
bool,
|
||||
"bash-completion",
|
||||
"Set to true to install bash 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.?});
|
||||
@ -88,6 +94,13 @@ pub fn build(b: *zbs.Builder) !void {
|
||||
try scdoc_step.install();
|
||||
}
|
||||
|
||||
if (bash_completion) {
|
||||
b.installFile(
|
||||
"completions/bash/riverctl",
|
||||
"share/bash-completion/completions/riverctl",
|
||||
);
|
||||
}
|
||||
|
||||
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