kaf: add shell completions
This commit is contained in:
@@ -2,6 +2,8 @@
|
||||
lib,
|
||||
buildGoModule,
|
||||
fetchFromGitHub,
|
||||
installShellFiles,
|
||||
stdenv,
|
||||
}:
|
||||
|
||||
buildGoModule rec {
|
||||
@@ -17,9 +19,18 @@ buildGoModule rec {
|
||||
|
||||
vendorHash = "sha256-1QcQeeYQFsStK27NVdyCAb1Y40lyifBf0dlSgzocG3Y=";
|
||||
|
||||
nativeBuildInputs = [ installShellFiles ];
|
||||
|
||||
# Many tests require a running Kafka instance
|
||||
doCheck = false;
|
||||
|
||||
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
|
||||
installShellCompletion --cmd kaf \
|
||||
--bash <($out/bin/kaf completion bash) \
|
||||
--zsh <($out/bin/kaf completion zsh) \
|
||||
--fish <($out/bin/kaf completion fish)
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
description = "Modern CLI for Apache Kafka, written in Go";
|
||||
mainProgram = "kaf";
|
||||
|
||||
Reference in New Issue
Block a user