Skip to content
Snippets Groups Projects
Select Git revision
  • fd141ce31d3967cda8a747be53994cd82b9a773a
  • master default
  • release_0.1.53
  • 0.1.15
  • 0.1.14
  • 0.1.13
  • 0.1.11
  • 0.1.10
  • 0.1.9
9 results

_user_identity.py

Blame
  • autocompletion.md 1.14 KiB

    Autocompletion

    You can generate autocompletion for your 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