Skip to content
Snippets Groups Projects
Select Git revision
  • f77a5dc146375c1facce7ec32a51a16f032b7bd8
  • master default protected
  • 308-add-a-runtime-api-to-simulate-max-net-tx-cost-for-the-end-user-fees-refund
  • 270-parametrage-de-la-gtest
  • 305-re-enable-sanity-tests
  • network/gdev-800 protected
  • cgeek/issue-297-cpu
  • gdev-800-tests
  • update-docker-compose-rpc-squid-names
  • fix-252
  • 1000i100-test
  • hugo/tmp-0.9.1
  • network/gdev-803 protected
  • hugo/endpoint-gossip
  • network/gdev-802 protected
  • hugo/distance-precompute
  • network/gdev-900 protected
  • tuxmain/anonymous-tx
  • debug/podman
  • hugo/195-doc
  • hugo/195-graphql-schema
  • gdev-900-0.10.1 protected
  • gdev-900-0.10.0 protected
  • gdev-900-0.9.2 protected
  • gdev-800-0.8.0 protected
  • gdev-900-0.9.1 protected
  • gdev-900-0.9.0 protected
  • gdev-803 protected
  • gdev-802 protected
  • runtime-801 protected
  • gdev-800 protected
  • runtime-800-bis protected
  • runtime-800 protected
  • runtime-800-backup protected
  • runtime-701 protected
  • runtime-700 protected
  • runtime-600 protected
  • runtime-500 protected
  • v0.4.1 protected
  • runtime-401 protected
  • v0.4.0 protected
41 results

autocompletion.md

Blame
  • autocompletion.md 1.13 KiB

    Autocompletion

    One can generate autocompletion for its favorite shell using the following option:

    cargo run -- completion --generator <GENERATOR>

    Where GENERATOR can be any of bash, elvish, fish, powershell and zsh.

    Bash

    First, get the completion file in a known place:

    mkdir -p ~/.local/share/duniter
    cargo run -- completion --generator bash > ~/.local/share/duniter/completion.bash

    You can now manually source the file when needed:

    source ~/.local/share/duniter/completion.bash

    Or you can automatically source it at bash startup by adding this to your ~/.bashrc file:

    [[ -f $HOME/.local/share/duniter/completion.bash ]] && source $HOME/.local/share/duniter/completion.bash

    You can now enjoy semantic completion of the ./target/release/duniter command using <Tab> key.

    Zsh

    Zsh equivalent

    # make directory to store completion
    mkdir -p ~/.zsh/completion
    # write the completion script
    cargo run -- completion --generator zsh > ~/.zsh/completion/_duniter.zsh
    # add the following lines to your ~/.zshrc
    fpath+=(~/.zsh/completion)
    compinit # might slow down terminal startup