From f4acb49ea148cdd899f7f29f1591c7bc853c2135 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 4 May 2024 03:03:18 +0200 Subject: Adding upstream version 1:2.12.0. Signed-off-by: Daniel Baumann --- completions/lz4 | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) (limited to 'completions/lz4') diff --git a/completions/lz4 b/completions/lz4 index f297b5d..8e2a777 100644 --- a/completions/lz4 +++ b/completions/lz4 @@ -1,25 +1,27 @@ # lz4 completion -*- shell-script -*- -_lz4() +_comp_cmd_lz4() { - local cur prev words cword - _init_completion || return + local cur prev words cword comp_args + _comp_initialize -- "$@" || return case $prev in -b) - _filedir + _comp_compgen_filedir return ;; esac if [[ $cur == -* ]]; then - COMPREPLY=($(compgen -X '-*#*' -W \ - '$(_parse_help "$1" -h) -B{4..7} -i{1..9}' -- "$cur")) + _comp_compgen -R help -- -h + _comp_compgen -- -X '-*#*' -W \ + '${COMPREPLY+"${COMPREPLY[@]}"} -B{4..7} -i{1..9}' return fi - local args word xspec="*.?(t)lz4" - _count_args + local REPLY word xspec="*.?(t)lz4" + _comp_count_args + local args=$REPLY ((args > 2)) && return for word in "${words[@]}"; do @@ -41,12 +43,11 @@ _lz4() esac done - _tilde "$cur" || return + _comp_compgen_tilde && return - local IFS=$'\n' compopt -o filenames - COMPREPLY=($(compgen -f -X "$xspec" -- "$cur") $(compgen -d -- "$cur")) + _comp_compgen -- -f -X "$xspec" -o plusdirs } && - complete -F _lz4 lz4 lz4c + complete -F _comp_cmd_lz4 lz4 lz4c # ex: filetype=sh -- cgit v1.2.3