summaryrefslogtreecommitdiffstats
path: root/completions/xdg-settings
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--completions/xdg-settings24
1 files changed, 11 insertions, 13 deletions
diff --git a/completions/xdg-settings b/completions/xdg-settings
index abd9246..df03222 100644
--- a/completions/xdg-settings
+++ b/completions/xdg-settings
@@ -1,9 +1,9 @@
# xdg-settings completion -*- shell-script -*-
-_xdg_settings()
+_comp_cmd_xdg_settings()
{
- local cur prev words cword
- _init_completion || return
+ local cur prev words cword comp_args
+ _comp_initialize -- "$@" || return
case $prev in
--help | --list | --manual | --version)
@@ -12,20 +12,18 @@ _xdg_settings()
esac
if [[ $cur == -* ]]; then
- COMPREPLY=($(compgen -W '$("$1" --help |
- tr "{|" "\n" | _parse_help -)' -- "$cur"))
+ _comp_compgen_help - <<<"$("$1" --help | tr '{|' '\n')"
return
fi
- local args
- _count_args
- if ((args == 1)); then
- COMPREPLY=($(compgen -W "get check set" -- "$cur"))
- elif ((args == 2)); then
- COMPREPLY=($(compgen -W \
- '$("$1" --list | awk "!/^Known/ { print \$1 }")' -- "$cur"))
+ local REPLY
+ _comp_count_args
+ if ((REPLY == 1)); then
+ _comp_compgen -- -W "get check set"
+ elif ((REPLY == 2)); then
+ _comp_compgen_split -- "$("$1" --list | _comp_awk '!/^Known/ { print $1 }')"
fi
} &&
- complete -F _xdg_settings xdg-settings
+ complete -F _comp_cmd_xdg_settings xdg-settings
# ex: filetype=sh