Commit 8f19a544 authored by Mario Rodas's avatar Mario Rodas
Browse files

tokio-console: install completions

parent 79404200
Loading
Loading
Loading
Loading
+12 −1
Original line number Diff line number Diff line
{ 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";