Unverified Commit 0af0d49c authored by Peder Bergebakken Sundt's avatar Peder Bergebakken Sundt Committed by GitHub
Browse files

cobra-cli: fix generated zsh completion function (#441206)

parents b7bd0a8e 5e23831d
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -44,6 +44,12 @@ buildGoModule rec {
      --bash <($out/bin/cobra-cli completion bash) \
      --fish <($out/bin/cobra-cli completion fish) \
      --zsh <($out/bin/cobra-cli completion zsh) \

    # Ironically, cobra-cli still uses old, slightly buggy completion code
    # This will correct the #compdef tag and add separate compdef line
    # allowing direct sourcing to also activate the completion
    substituteInPlace "$out/share/zsh/site-functions/_cobra-cli" \
      --replace-fail '#compdef _cobra-cli cobra-cli' "#compdef cobra-cli''\ncompdef _cobra-cli cobra-cli"
  '';

  meta = {