Add a comment with example installation instructions

This commit is contained in:
Vladimir Zhelezov 2020-12-15 09:43:06 +01:00
parent 99af527f16
commit bee666704b
2 changed files with 34 additions and 0 deletions

View File

@ -8,6 +8,23 @@
# That said, we *do* remove colon (:) from COMP_WORDBREAKS which impacts # That said, we *do* remove colon (:) from COMP_WORDBREAKS which impacts
# the rest of the session and completion for other programs. # the rest of the session and completion for other programs.
# INSTALLATION:
# To install you can simply source this file from your shell's startup files.
# Alternatively, copy/symlink it into `${BASH_COMPLETION_USER_DIR}/completions`
# or `${XDG_DATA_HOME:-$HOME/.local/share}/bash-completion/completions`, rename
# it to either `hledger`, `_hledger` or `hledger.bash`, and it will be loaded
# dynamically the first time you use the `hledger` command. Optionally, create
# symlinks to this file for any extensions used e.g.:
# mkdir -p "${BASH_COMPLETION_USER_DIR:-${XDG_DATA_HOME:-$HOME/.local/share}/bash-completion}/completions" &&
# cd "${BASH_COMPLETION_USER_DIR:-${XDG_DATA_HOME:-$HOME/.local/share}/bash-completion}/completions" &&
# cp /path/to/hledger-completion.bash hledger &&
# ln -s hledger hledger-ui &&
# ln -s hledger hledger-web &&
# : done.
_hledger_completion() { _hledger_completion() {
local cur prev words cword local cur prev words cword
_init_completion -n : || return 0 _init_completion -n : || return 0

View File

@ -8,6 +8,23 @@
# That said, we *do* remove colon (:) from COMP_WORDBREAKS which impacts # That said, we *do* remove colon (:) from COMP_WORDBREAKS which impacts
# the rest of the session and completion for other programs. # the rest of the session and completion for other programs.
# INSTALLATION:
# To install you can simply source this file from your shell's startup files.
# Alternatively, copy/symlink it into `${BASH_COMPLETION_USER_DIR}/completions`
# or `${XDG_DATA_HOME:-$HOME/.local/share}/bash-completion/completions`, rename
# it to either `hledger`, `_hledger` or `hledger.bash`, and it will be loaded
# dynamically the first time you use the `hledger` command. Optionally, create
# symlinks to this file for any extensions used e.g.:
# mkdir -p "${BASH_COMPLETION_USER_DIR:-${XDG_DATA_HOME:-$HOME/.local/share}/bash-completion}/completions" &&
# cd "${BASH_COMPLETION_USER_DIR:-${XDG_DATA_HOME:-$HOME/.local/share}/bash-completion}/completions" &&
# cp /path/to/hledger-completion.bash hledger &&
# ln -s hledger hledger-ui &&
# ln -s hledger hledger-web &&
# : done.
_hledger_completion() { _hledger_completion() {
local cur prev words cword local cur prev words cword
_init_completion -n : || return 0 _init_completion -n : || return 0