From f2621414ee5f2f601424c22f00e207903e3b6104 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 4 May 2024 03:03:18 +0200 Subject: Merging upstream version 1:2.12.0. Signed-off-by: Daniel Baumann --- completions/xdg-settings | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) (limited to 'completions/xdg-settings') 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 -- cgit v1.2.3