oha: Install shell completions
This commit is contained in:
@@ -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
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user