tokio-console: install completions

This commit is contained in:
Mario Rodas 2024-03-26 04:20:00 +00:00
parent 7940420063
commit 8f19a5443f

View file

@ -1,5 +1,6 @@
{ lib
, fetchFromGitHub
, installShellFiles
, rustPlatform
, protobuf
}:
@ -17,7 +18,10 @@ rustPlatform.buildRustPackage rec {
cargoHash = "sha256-86KQpRpYSCQs6SUeG0HV26b58x/QUyovoL+5fg8JCOI=";
nativeBuildInputs = [ protobuf ];
nativeBuildInputs = [
installShellFiles
protobuf
];
# uses currently unstable tokio features
RUSTFLAGS = "--cfg tokio_unstable";
@ -29,6 +33,13 @@ rustPlatform.buildRustPackage rec {
"--skip config::tests::toml_example_changed"
];
postInstall = ''
installShellCompletion --cmd tokio-console \
--bash <($out/bin/tokio-console --log-dir $(mktemp -d) gen-completion bash) \
--fish <($out/bin/tokio-console --log-dir $(mktemp -d) gen-completion fish) \
--zsh <($out/bin/tokio-console --log-dir $(mktemp -d) gen-completion zsh)
'';
meta = with lib; {
description = "A debugger for asynchronous Rust code";
homepage = "https://github.com/tokio-rs/console";