feat: add shell completion generation

This commit is contained in:
2026-02-13 11:05:24 +01:00
parent 9582864321
commit 0c26974774
2 changed files with 12 additions and 0 deletions

View File

@@ -65,6 +65,10 @@
src = ./.;
vendorHash = "sha256-EpGgfiCqJjHEOphV2x8FmXeIFls7eq2NVxb/or4NLUo=";
nativeBuildInputs = with pkgs; [
installShellFiles
];
subPackages = [
"."
];
@@ -75,6 +79,13 @@
sed -i "s/rm -rf SpotiFLAC//g" ./tools/fetch_spotiflac_backend.sh
./tools/fetch_spotiflac_backend.sh
'';
postInstall = ''
installShellCompletion --cmd spotiflac-cli \
--bash <($out/bin/spotiflac-cli completion bash) \
--fish <($out/bin/spotiflac-cli completion fish) \
--zsh <($out/bin/spotiflac-cli completion zsh)
'';
});
}
);

View File

@@ -17,6 +17,7 @@ func main() {
cmd := &cli.Command{
Name: "spotiflac-cli",
EnableShellCompletion: true,
Flags: []cli.Flag{
&cli.StringFlag{
Name: "download",