chore: modifies envvar check

Modifies the `CHEAT_USE_FZF` envvar check within the bash autocompletion
script for clarity.
This commit is contained in:
Chris Lane 2020-02-02 14:39:04 -05:00
parent ac1012f743
commit 9868ba2d68
1 changed files with 2 additions and 2 deletions

View File

@ -3,7 +3,7 @@
# generate cheatsheet completions, optionally using `fzf`
_cheat_complete_cheatsheets()
{
if [[ "${CHEAT_USE_FZF:-0}" != 0 ]]; then
if [[ "$CHEAT_USE_FZF" = true ]]; then
FZF_COMPLETION_TRIGGER='' _fzf_complete "--no-multi" "$@" < <(
cheat -l | tail -n +2 | cut -d' ' -f1
)
@ -15,7 +15,7 @@ _cheat_complete_cheatsheets()
# generate tag completions, optionally using `fzf`
_cheat_complete_tags()
{
if [[ "${CHEAT_USE_FZF:-0}" != 0 ]]; then
if [ "$CHEAT_USE_FZF" = true ]; then
FZF_COMPLETION_TRIGGER='' _fzf_complete "--no-multi" "$@" < <(cheat -T)
else
COMPREPLY=( $(compgen -W "$(cheat -T)" -- "$cur") )