Merge pull request #233586 from QJoly/pv-migration-completion

pv-migrate: add shell completions
This commit is contained in:
Bobby Rong 2023-05-26 18:47:41 +08:00 committed by GitHub
commit a83cb9c559
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,4 +1,4 @@
{ lib, buildGoModule, fetchFromGitHub }: { lib, buildGoModule, fetchFromGitHub, installShellFiles }:
buildGoModule rec { buildGoModule rec {
pname = "pv-migrate"; pname = "pv-migrate";
@ -23,11 +23,22 @@ buildGoModule rec {
"-X main.date=1970-01-01-00:00:01" "-X main.date=1970-01-01-00:00:01"
]; ];
nativeBuildInputs = [
installShellFiles
];
postInstall = ''
installShellCompletion --cmd pv-migrate \
--bash <($out/bin/pv-migrate completion bash) \
--fish <($out/bin/pv-migrate completion fish) \
--zsh <($out/bin/pv-migrate completion zsh)
'';
meta = with lib; { meta = with lib; {
description = "CLI tool to easily migrate Kubernetes persistent volumes "; description = "CLI tool to easily migrate Kubernetes persistent volumes ";
homepage = "https://github.com/utkuozdemir/pv-migrate"; homepage = "https://github.com/utkuozdemir/pv-migrate";
changelog = "https://github.com/utkuozdemir/pv-migrate/releases/tag/${version}"; changelog = "https://github.com/utkuozdemir/pv-migrate/releases/tag/${version}";
license = licenses.afl20; license = licenses.afl20;
maintainers = [ maintainers.ivankovnatsky ]; maintainers = with lib.maintainers; [ ivankovnatsky qjoly ];
}; };
} }