pritunl-client: add shell completions

This commit is contained in:
Mathieu Post 2023-05-11 14:57:58 +02:00
parent f212785e1e
commit f85cd886c4
No known key found for this signature in database

View file

@ -1,4 +1,4 @@
{ lib, buildGoModule, fetchFromGitHub }:
{ lib, buildGoModule, fetchFromGitHub, installShellFiles }:
buildGoModule rec {
pname = "pritunl-client";
@ -14,8 +14,16 @@ buildGoModule rec {
modRoot = "cli";
vendorHash = "sha256-miwGLWpoaavg/xcw/0pNBYCdovBnvjP5kdaaGPcRuWk=";
nativeBuildInputs = [
installShellFiles
];
postInstall = ''
mv $out/bin/cli $out/bin/pritunl-client
installShellCompletion --cmd pritunl-client \
--bash <($out/bin/pritunl-client completion bash) \
--fish <($out/bin/pritunl-client completion fish) \
--zsh <($out/bin/pritunl-client completion zsh)
'';
meta = with lib; {