@@ -6,7 +6,7 @@ _comp_cmd_7z()
66 _comp_initialize -n = -- " $@ " || return
77
88 if (( cword == 1 )) ; then
9- COMPREPLY=( $( compgen - W ' a b d e h i l rn t u x' -- " $cur " ) )
9+ _comp_compgen -- - W ' a b d e h i l rn t u x'
1010 return
1111 fi
1212
@@ -15,7 +15,7 @@ _comp_cmd_7z()
1515
1616 case $cur in
1717 -ao* )
18- COMPREPLY=( $( compgen - P" ${cur: 0: 3} " -W ' a s t u' -- " ${cur : 3} " ) )
18+ _comp_compgen -c " ${cur : 3} " -- - P" ${cur: 0: 3} " -W ' a s t u'
1919 return
2020 ;;
2121 -? (a)[ix]* )
@@ -29,35 +29,27 @@ _comp_cmd_7z()
2929 COMPREPLY=($( compgen -P" $opt " -W ' @ ! r@ r-@ r0@ r! r-! r0!' \
3030 -- " $cur " ) )
3131 elif [[ $cur == ? (r@ (-| 0| ))@* ]]; then
32- local IFS=$' \t\n ' reset=$( shopt -po noglob)
33- set -o noglob
34- COMPREPLY=($( compgen -P" ${opt}${cur%%@* } @" -f -- " ${cur#*@ } " ) )
35- $reset
32+ _comp_compgen -c " ${cur#*@ } " -- -P" ${opt}${cur%%@* } @" -f
3633 compopt -o filenames
3734 fi
3835 return
3936 ;;
4037 -mhe=* | -mhc=* | -ms=* | -mt=* )
41- COMPREPLY=( $( compgen -W ' on off ' -- " ${cur#* =} " ) )
38+ _comp_compgen -c " ${cur#* =} " -- -W ' on off '
4239 return
4340 ;;
4441 -mx=* )
45- COMPREPLY=( $( compgen - W ' 0 1 3 5 7 9' -- " ${cur #* =} " ) )
42+ _comp_compgen -c " ${cur #* =} " -- - W ' 0 1 3 5 7 9'
4643 return
4744 ;;
4845 -o* | -w?* )
49- local reset=$( shopt -po noglob)
50- set -o noglob
5146 compopt -o filenames
52- local IFS=$' \n '
53- COMPREPLY=($( compgen -d -P" ${cur: 0: 2} " -S/ -- " ${cur: 2} " ) )
54- _comp_unlocal IFS
55- $reset
47+ _comp_compgen -c " ${cur: 2} " -- -d -P" ${cur: 0: 2} " -S/
5648 compopt -o nospace
5749 return
5850 ;;
5951 -r?* )
60- COMPREPLY=( $( compgen -P " ${cur: 0 : 2} " -W ' - 0 ' -- " ${cur: 2} " ) )
52+ _comp_compgen -c " ${cur: 2} " -- -P " ${cur: 0 : 2} " -W ' - 0 '
6153 return
6254 ;;
6355 -scs* )
@@ -66,7 +58,7 @@ _comp_cmd_7z()
6658 return
6759 ;;
6860 -ssc?* )
69- COMPREPLY=( $( compgen -P " ${cur: 0 : 4} " -W ' - ' -- " ${cur: 4} " ) )
61+ _comp_compgen -c " ${cur: 4} " -- -P " ${cur: 0 : 4} " -W ' - '
7062 return
7163 ;;
7264 -t* )
0 commit comments