Skip to content
Snippets Groups Projects
Select Git revision
  • upgrade_polkadot_v0.9.42
  • archive_upgrade_polkadot_v0.9.42
  • pallet-benchmark
  • master default protected
  • jrx/workspace_tomls
  • hugo-gtest
  • hugo-rework-genesis
  • hugo-remove-duniter-account
  • hugo-tmp
  • release/poka-chainspec-gdev5-pini-docker
  • release/poka-chainspec-gdev5
  • ud-time-64
  • distance
  • david-wot-scenarios-cucumber
  • release/runtime-400
  • elois-revoc-with-old-key
  • elois-smish-members-cant-change-or-rem-idty
  • release/runtime-300
  • elois-fix-idty-post-genesis
  • elois-fix-sufficients-change-owner-key
  • v0.4.0
  • runtime-400
  • runtime-303
  • runtime-302
  • v0.3.0
  • runtime-301
  • v0.2.0
  • runtime-300
  • runtime-201
  • runtime-200
  • runtime-105
  • runtime-104
  • runtime-103
  • runtime-102
  • runtime-101
  • v0.1.0
  • runtime-100
37 results

autocompletion.md

Blame
  • Forked from nodes / rust / Duniter v2S
    241 commits behind the upstream repository.
    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