Unverified Commit 9723faa8 authored by Aleksana's avatar Aleksana Committed by GitHub
Browse files

kaf: add shell completions (#423556)

parents c39a46bb 0dd1faf8
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -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";