oha: Install shell completions

This commit is contained in:
Jonathan Davies
2026-07-11 12:22:39 +01:00
parent 1927af6d24
commit 5330277dce
+11 -1
View File
@@ -4,6 +4,7 @@
fetchFromGitHub,
stdenv,
cacert,
installShellFiles,
libredirect,
pkg-config,
openssl,
@@ -29,7 +30,10 @@ rustPlatform.buildRustPackage (finalAttrs: {
CARGO_PROFILE_RELEASE_CODEGEN_UNITS = "1";
};
nativeBuildInputs = lib.optionals stdenv.hostPlatform.isLinux [
nativeBuildInputs = [
installShellFiles
]
++ lib.optionals stdenv.hostPlatform.isLinux [
pkg-config
];
@@ -54,6 +58,12 @@ rustPlatform.buildRustPackage (finalAttrs: {
"--skip=test_proxy"
];
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
for shell in bash fish zsh; do
installShellCompletion --cmd oha --$shell <($out/bin/oha --completions $shell)
done
'';
nativeInstallCheckInputs = [
versionCheckHook
];