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/ccze | 35 ++++++++++++++++++----------------- 1 file changed, 18 insertions(+), 17 deletions(-) (limited to 'completions/ccze') diff --git a/completions/ccze b/completions/ccze index 35f4c3f..31602b0 100644 --- a/completions/ccze +++ b/completions/ccze @@ -1,44 +1,45 @@ # ccze(1) completion -*- shell-script -*- -_ccze() +_comp_cmd_ccze() { - local cur prev words cword split - _init_completion -s || return + local cur prev words cword was_split comp_args + _comp_initialize -s -- "$@" || return + local noargopts='!(-*|*[acFmop]*)' + # shellcheck disable=SC2254 case $prev in -'?' | --help | --usage | -V | --version) return ;; - --argument | --color | -!(-*)[ac]) + --argument | --color | -${noargopts}[ac]) # TODO? return ;; - --rcfile | -!(-*)F) - _filedir + --rcfile | -${noargopts}F) + _comp_compgen_filedir return ;; - --mode | -!(-*)m) - COMPREPLY=($(compgen -W "curses ansi html" -- "$cur")) + --mode | -${noargopts}m) + _comp_compgen -- -W "curses ansi html" return ;; - --option | -!(-*)o) + --option | -${noargopts}o) local -a opts=(scroll wordcolor lookups transparent cssfile) - COMPREPLY=($(compgen -W '${opts[@]} ${opts[@]/#/no}' -- "$cur")) + _comp_compgen -- -W '"${opts[@]}" "${opts[@]/#/no}"' return ;; - --plugin | -!(-*)p) - COMPREPLY=($(compgen -W '$("$1" --list-plugins | command \ - sed -ne "s/^\([a-z0-9]\{1,\}\)[[:space:]]\{1,\}|.*/\1/p")' \ - -- "$cur")) + --plugin | -${noargopts}p) + _comp_compgen_split -- "$("$1" --list-plugins | command \ + sed -ne 's/^\([a-z0-9]\{1,\}\)[[:space:]]\{1,\}|.*/\1/p')" return ;; esac - $split && return + [[ $was_split ]] && return - COMPREPLY=($(compgen -W '$(_parse_help "$1")' -- "$cur")) + _comp_compgen_help [[ ${COMPREPLY-} == *= ]] && compopt -o nospace } && - complete -F _ccze ccze + complete -F _comp_cmd_ccze ccze # ex: filetype=sh -- cgit v1.2.3