Bugfix in preset completion

This commit is contained in:
Shy 2017-04-17 21:25:19 +02:00
parent 8e00742d55
commit 5d0a29ee0a

16
_c4ctrl
View file

@ -34,23 +34,23 @@ _arguments -s \
case "$state" in case "$state" in
presets*) presets*)
local ret=0 c4ctrl_cfg_dir local ret=1 c4ctrl_cfg_dir
if [[ "$state" == "presets_read" ]]; then
# 'off' and 'random' are builtins and always 'readable'.
_values Presets 'off' 'random'
ret=$?
fi
if [[ "$XDG_CONFIG_DIR" ]]; then if [[ "$XDG_CONFIG_DIR" ]]; then
c4ctrl_cfg_dir="$XDG_CONFIG_DIR/c4ctrl" c4ctrl_cfg_dir="$XDG_CONFIG_DIR/c4ctrl"
else else
c4ctrl_cfg_dir="$HOME/.config/c4ctrl" c4ctrl_cfg_dir="$HOME/.config/c4ctrl"
fi fi
if [[ -d "$c4ctrl_cfg_dir" ]]; then if [[ -d "$c4ctrl_cfg_dir" ]]; then
if [[ "$state" == "presets_read" ]]; then
# 'off' and 'random' are builtins and always 'readable'.
_values Presets 'off' 'random'
ret=$?
fi
_files -W "$c4ctrl_cfg_dir" _files -W "$c4ctrl_cfg_dir"
ret=$((ret+?)) ret=$((ret+?))
return ret
fi fi
return 1 return ret
;; ;;
esac esac