summaryrefslogtreecommitdiff
path: root/completions/chmod
diff options
context:
space:
mode:
Diffstat (limited to 'completions/chmod')
-rw-r--r--completions/chmod11
1 files changed, 6 insertions, 5 deletions
diff --git a/completions/chmod b/completions/chmod
index 849da851..d3fc3499 100644
--- a/completions/chmod
+++ b/completions/chmod
@@ -6,7 +6,7 @@ _chmod()
_init_completion -s || return
case $prev in
- --help|--version)
+ --help | --version)
return
;;
--reference)
@@ -20,10 +20,11 @@ _chmod()
# Adapted from coreutils 8.28 chmod man page
local modearg="-@(@(+([rwxXst])|[ugo])|+([0-7]))"
+ # shellcheck disable=SC2053
if [[ $cur == -* && $cur != $modearg ]]; then
local opts=$(_parse_help "$1")
- COMPREPLY=( $(compgen -W '${opts:-$(_parse_usage "$1")}' -- "$cur") )
- [[ $COMPREPLY == *= ]] && compopt -o nospace
+ COMPREPLY=($(compgen -W '${opts:-$(_parse_usage "$1")}' -- "$cur"))
+ [[ ${COMPREPLY-} == *= ]] && compopt -o nospace
return
fi
@@ -31,10 +32,10 @@ _chmod()
_count_args "" "" "$modearg"
case $args in
- 1) ;; # mode
+ 1) ;; # mode
*) _filedir ;;
esac
} &&
-complete -F _chmod chmod
+ complete -F _chmod chmod
# ex: filetype=sh