From 2d12cbeb72baaa56961b054067300a057716dea3 Mon Sep 17 00:00:00 2001 From: Koichi Murase Date: Sat, 6 May 2023 08:05:31 +0900 Subject: [PATCH 01/15] fix(abook,curl,pack200,patch,perl): specify -a to filedir --- completions/abook | 4 ++-- completions/curl | 2 +- completions/pack200 | 2 +- completions/patch | 2 +- completions/perl | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/completions/abook b/completions/abook index 2615a3c4278..b50f640c80d 100644 --- a/completions/abook +++ b/completions/abook @@ -33,11 +33,11 @@ _comp_cmd_abook() ;; --infile) COMPREPLY=($(compgen -W stdin -- "$cur")) - _comp_compgen_filedir + _comp_compgen -a filedir ;; --outfile) COMPREPLY=($(compgen -W stdout -- "$cur")) - _comp_compgen_filedir + _comp_compgen -a filedir ;; --config | --datafile) _comp_compgen_filedir diff --git a/completions/curl b/completions/curl index bdefa4af78a..086e7ad9f96 100644 --- a/completions/curl +++ b/completions/curl @@ -144,7 +144,7 @@ _comp_cmd_curl() ;; --stderr) COMPREPLY=($(compgen -W '-' -- "$cur")) - _comp_compgen_filedir + _comp_compgen -a filedir return ;; --tls-max) diff --git a/completions/pack200 b/completions/pack200 index a69a496185f..520e432e980 100644 --- a/completions/pack200 +++ b/completions/pack200 @@ -33,7 +33,7 @@ _comp_cmd_pack200() ;; -l | --log-file) COMPREPLY=($(compgen -W '-' -- "$cur")) - _comp_compgen_filedir log + _comp_compgen -a filedir log return ;; -r | --repack) diff --git a/completions/patch b/completions/patch index 995906238a6..3107b55cc13 100644 --- a/completions/patch +++ b/completions/patch @@ -22,7 +22,7 @@ _comp_cmd_patch() ;; --output | --reject-file | -${noargopts}[or]) [[ ! $cur || $cur == - ]] && COMPREPLY=(-) - _comp_compgen_filedir + _comp_compgen -a filedir return ;; --quoting-style) diff --git a/completions/perl b/completions/perl index e0e9ad95fde..bd408a6af05 100644 --- a/completions/perl +++ b/completions/perl @@ -139,7 +139,7 @@ _comp_cmd_perldoc() -- "$cur")) fi fi - _comp_compgen_filedir 'p@([lm]|od)' + _comp_compgen -a filedir 'p@([lm]|od)' fi } && complete -F _comp_cmd_perldoc -o bashdefault perldoc From 4e51a79a14d2cc5bd5d4cc26ef28e209470b9ddb Mon Sep 17 00:00:00 2001 From: Koichi Murase Date: Sat, 6 May 2023 10:25:58 +0900 Subject: [PATCH 02/15] refactor(strings,tshark,tune2fs): use _comp_compgen -c for filedir --- completions/strings | 3 +-- completions/tshark | 6 ++---- completions/tune2fs | 3 +-- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/completions/strings b/completions/strings index 898c76d0caa..3b1a52d654f 100644 --- a/completions/strings +++ b/completions/strings @@ -47,8 +47,7 @@ _comp_cmd_strings() [[ ${COMPREPLY-} == *= ]] && compopt -o nospace return elif [[ $cur == @* ]]; then - cur=${cur:1} - _comp_compgen_filedir + _comp_compgen -c "${cur:1}" filedir COMPREPLY=("${COMPREPLY[@]/#/@}") return fi diff --git a/completions/tshark b/completions/tshark index 3191bb214fc..8a6d0753f34 100644 --- a/completions/tshark +++ b/completions/tshark @@ -20,8 +20,7 @@ _comp_cmd_tshark() ;; -o*) if [[ $cur == *:* ]]; then - cur=${cur#*:} - _comp_compgen_filedir + _comp_compgen -c "${cur#*:}" filedir else [[ -v _comp_cmd_tshark__prefs ]] || _comp_cmd_tshark__prefs="$("$1" -G defaultprefs 2>/dev/null | command sed -ne 's/^#\{0,1\}\([a-z0-9_.-]\{1,\}:\).*/\1/p' | @@ -104,8 +103,7 @@ _comp_cmd_tshark() ;; -*X) if [[ ${cur:${#prefix}} == lua_script:* ]]; then - cur=${cur#*:} - _comp_compgen_filedir lua + _comp_compgen -c "${cur#*:}" filedir lua else COMPREPLY=($(compgen -P "$prefix" -W 'lua_script:' -- \ "${cur:${#prefix}}")) diff --git a/completions/tune2fs b/completions/tune2fs index 902d5b3b228..2b5dc78d6be 100644 --- a/completions/tune2fs +++ b/completions/tune2fs @@ -55,8 +55,7 @@ _comp_cmd_tune2fs() return fi - : "${cur:=/dev/}" - _comp_compgen_filedir + _comp_compgen -c "${cur:-/dev/}" filedir } && complete -F _comp_cmd_tune2fs tune2fs From 3cf004c7cbc0cdbc304ea3e0600a146c7f2cbfaa Mon Sep 17 00:00:00 2001 From: Koichi Murase Date: Thu, 4 May 2023 07:00:51 +0900 Subject: [PATCH 03/15] fix(_comp_compgen): prevent IFS from affecting `-- "$cur"` The IFS separators specified by the options `-s SEP` or `-l` option is intended to take effect in evaluating `compgen`, such as the word splitting in `-W text`. However, if we set IFS in a separate command from `compgen`, the arguments specified to `compgen` would also be unexpectedly affected. Here, ${_cur:+-- "$_cur"} is intended to be expanded to two words if `_cur` is non-empty. However, when the separators do not contain a whitespace, it unexpectedly results in a single word. IFS can be specified as a temporary environment of the `compgen` command so that it does not affect the arguments of `compgen`. --- bash_completion | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/bash_completion b/bash_completion index 1be07cc2d31..1f42fd16b55 100644 --- a/bash_completion +++ b/bash_completion @@ -533,8 +533,7 @@ _comp_compgen() local _result _result=$( - IFS=$_ifs - compgen "$@" ${_cur:+-- "$_cur"} + IFS=$_ifs compgen "$@" ${_cur:+-- "$_cur"} ) || { local _status=$? if [[ $_append ]]; then From 1623682e88b41e1dcd1195055460c05c910a9948 Mon Sep 17 00:00:00 2001 From: Koichi Murase Date: Wed, 3 May 2023 21:26:09 +0900 Subject: [PATCH 04/15] fix(pwdx): fix use of _parse_help --- completions/pwdx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/completions/pwdx b/completions/pwdx index aebf1d2caca..110de83b1df 100644 --- a/completions/pwdx +++ b/completions/pwdx @@ -12,9 +12,9 @@ _comp_cmd_pwdx() esac if [[ $cur == -* ]]; then - local help='$(_parse_help "$1")' + local help=$(_parse_help "$1") [[ $help ]] || help=-V - COMPREPLY=($(compgen -W "$help" -- "$cur")) + COMPREPLY=($(compgen -W '$help' -- "$cur")) else _pids fi From 5701a795f99cee1a5669f217bcaae00548dc0d1a Mon Sep 17 00:00:00 2001 From: Koichi Murase Date: Mon, 1 May 2023 14:37:25 +0900 Subject: [PATCH 05/15] fix: use _comp_compgen for COMPREPLY=($(compgen ... -- "$cur")) --- completions/7z | 2 +- completions/_adb | 4 +-- completions/_cal | 4 +-- completions/_dmesg | 2 +- completions/_eject | 2 +- completions/_ionice | 4 +-- completions/_mock | 2 +- completions/_modules | 2 +- completions/_nmcli | 20 ++++++------ completions/_rfkill | 2 +- completions/_rtcwake | 4 +-- completions/_slackpkg | 6 ++-- completions/_su | 4 +-- completions/_svn | 10 +++--- completions/_svnadmin | 10 +++--- completions/_svnlook | 8 ++--- completions/_udevadm | 8 ++--- completions/_xm | 10 +++--- completions/_yum | 6 ++-- completions/abook | 4 +-- completions/add_members | 2 +- completions/alias | 2 +- completions/ant | 4 +-- completions/apache2ctl | 2 +- completions/aptitude | 2 +- completions/arch | 2 +- completions/arp | 2 +- completions/asciidoc | 4 +-- completions/aspell | 6 ++-- completions/avctrl | 4 +-- completions/bind | 2 +- completions/bk | 2 +- completions/brctl | 2 +- completions/bts | 2 +- completions/cancel | 2 +- completions/ccze | 4 +-- completions/cfrun | 2 +- completions/chage | 2 +- completions/check_db | 2 +- completions/check_perms | 2 +- completions/chkconfig | 2 +- completions/chromium-browser | 4 +-- completions/chronyc | 2 +- completions/complete | 10 +++--- completions/convert | 20 ++++++------ completions/cpio | 2 +- completions/cppcheck | 6 ++-- completions/crontab | 2 +- completions/cryptsetup | 2 +- completions/curl | 20 ++++++------ completions/cvs | 28 ++++++++-------- completions/cvsps | 2 +- completions/dd | 2 +- completions/declare | 8 ++--- completions/dhclient | 2 +- completions/dnssec-keygen | 2 +- completions/dpkg | 10 +++--- completions/dpkg-source | 8 ++--- completions/ebtables | 2 +- completions/ecryptfs-migrate-home | 2 +- completions/export | 2 +- completions/faillog | 2 +- completions/feh | 6 ++-- completions/find | 6 ++-- completions/fio | 22 ++++++------- completions/firefox | 2 +- completions/flake8 | 2 +- completions/freeciv | 6 ++-- completions/function | 2 +- completions/genaliases | 2 +- completions/getconf | 2 +- completions/getent | 8 ++--- completions/gnokii | 28 ++++++++-------- completions/gnome-mplayer | 4 +-- completions/gnome-screenshot | 2 +- completions/gpasswd | 4 +-- completions/gpgv | 2 +- completions/gprof | 2 +- completions/groupdel | 2 +- completions/groupmems | 4 +-- completions/groupmod | 2 +- completions/hcitool | 18 +++++------ completions/hddtemp | 2 +- completions/help | 2 +- completions/htop | 2 +- completions/hunspell | 2 +- completions/id | 2 +- completions/ifup | 2 +- completions/inject | 2 +- completions/inotifywait | 2 +- completions/installpkg | 2 +- completions/invoke-rc.d | 2 +- completions/ip | 24 +++++++------- completions/iperf | 6 ++-- completions/ipmitool | 18 +++++------ completions/ipsec | 8 ++--- completions/iptables | 2 +- completions/iscsiadm | 8 ++--- completions/isort | 2 +- completions/iwconfig | 20 ++++++------ completions/iwlist | 2 +- completions/iwpriv | 8 ++--- completions/iwspy | 4 +-- completions/jar | 2 +- completions/jarsigner | 4 +-- completions/jpegoptim | 4 +-- completions/jps | 2 +- completions/jq | 2 +- completions/jshint | 4 +-- completions/k3b | 2 +- completions/kcov | 4 +-- completions/koji | 4 +-- completions/ktutil | 4 +-- completions/lastlog | 2 +- completions/ldapsearch | 8 ++--- completions/ldapvi | 10 +++--- completions/lftpget | 2 +- completions/links | 12 +++---- completions/lintian | 4 +-- completions/list_admins | 2 +- completions/list_members | 2 +- completions/lpq | 4 +-- completions/lpr | 6 ++-- completions/lrzip | 4 +-- completions/lsof | 6 ++-- completions/luseradd | 2 +- completions/luserdel | 2 +- completions/lvm | 54 +++++++++++++++---------------- completions/mailmanctl | 2 +- completions/make | 2 +- completions/makepkg | 2 +- completions/man | 4 +-- completions/mcrypt | 2 +- completions/mdadm | 4 +-- completions/mdtool | 2 +- completions/minicom | 4 +-- completions/mktemp | 2 +- completions/mmsitepass | 2 +- completions/modprobe | 2 +- completions/mplayer | 16 ++++----- completions/mr | 10 +++--- completions/mtx | 6 ++-- completions/munin-node-configure | 2 +- completions/mussh | 6 ++-- completions/mypy | 2 +- completions/mysql | 6 ++-- completions/mysqladmin | 2 +- completions/nc | 2 +- completions/newusers | 2 +- completions/ngrep | 2 +- completions/nslookup | 2 +- completions/ntpdate | 4 +-- completions/oggdec | 4 +-- completions/openssl | 8 ++--- completions/opera | 2 +- completions/optipng | 8 ++--- completions/p4 | 6 ++-- completions/pack200 | 10 +++--- completions/patch | 8 ++--- completions/pdftoppm | 6 ++-- completions/pdftotext | 4 +-- completions/perl | 4 +-- completions/perlcritic | 6 ++-- completions/pgrep | 4 +-- completions/ping | 6 ++-- completions/pkg-get | 6 ++-- completions/pkgadd | 4 +-- completions/pkgrm | 2 +- completions/pkgutil | 6 ++-- completions/pm-powersave | 2 +- completions/portsnap | 2 +- completions/postfix | 2 +- completions/postmap | 2 +- completions/postsuper | 2 +- completions/printenv | 2 +- completions/protoc | 4 +-- completions/ps | 4 +-- completions/psql | 2 +- completions/puppet | 16 ++++----- completions/pwdx | 2 +- completions/pycodestyle | 2 +- completions/pydoc | 2 +- completions/pydocstyle | 2 +- completions/pylint | 2 +- completions/pytest | 14 ++++---- completions/python | 2 +- completions/qemu | 14 ++++---- completions/querybts | 4 +-- completions/quota | 8 ++--- completions/radvdump | 2 +- completions/rdesktop | 8 ++--- completions/removepkg | 2 +- completions/reportbug | 2 +- completions/resolvconf | 2 +- completions/ri | 4 +-- completions/rmlist | 2 +- completions/route | 2 +- completions/rpcdebug | 2 +- completions/rpm | 4 +-- completions/rpm2tgz | 2 +- completions/rsync | 4 +-- completions/sbopkg | 2 +- completions/screen | 8 ++--- completions/secret-tool | 6 ++-- completions/sh | 4 +-- completions/sha256sum | 2 +- completions/shellcheck | 4 +-- completions/smartctl | 16 ++++----- completions/smbclient | 8 ++--- completions/sqlite3 | 2 +- completions/ssh | 36 ++++++++++----------- completions/ssh-add | 2 +- completions/ssh-keygen | 10 +++--- completions/strace | 4 +-- completions/strings | 2 +- completions/sudo | 4 +-- completions/svcadm | 14 ++++---- completions/svk | 6 ++-- completions/sync_members | 2 +- completions/sysbench | 32 +++++++++--------- completions/tar | 16 ++++----- completions/tcpdump | 6 ++-- completions/tcpkill | 2 +- completions/tipc | 36 ++++++++++----------- completions/tree | 2 +- completions/tshark | 6 ++-- completions/tsig-keygen | 2 +- completions/tune2fs | 12 +++---- completions/ulimit | 4 +-- completions/unace | 4 +-- completions/unpack200 | 4 +-- completions/unrar | 2 +- completions/update-alternatives | 2 +- completions/update-rc.d | 4 +-- completions/useradd | 2 +- completions/userdel | 2 +- completions/usermod | 4 +-- completions/valgrind | 10 +++--- completions/vmstat | 2 +- completions/vncviewer | 2 +- completions/vpnc | 16 ++++----- completions/watch | 2 +- completions/wget | 12 +++---- completions/wine | 2 +- completions/wodim | 4 +-- completions/wsimport | 2 +- completions/xdg-mime | 14 ++++---- completions/xdg-settings | 2 +- completions/xev | 2 +- completions/xfreerdp | 8 ++--- completions/xgamma | 2 +- completions/xmllint | 2 +- completions/xmms | 2 +- completions/xrandr | 32 +++++++++--------- completions/xz | 4 +-- completions/yum-arch | 2 +- completions/zopflipng | 4 +-- 257 files changed, 708 insertions(+), 708 deletions(-) diff --git a/completions/7z b/completions/7z index e4beae52e46..70752b608ec 100644 --- a/completions/7z +++ b/completions/7z @@ -6,7 +6,7 @@ _comp_cmd_7z() _comp_initialize -n = -- "$@" || return if ((cword == 1)); then - COMPREPLY=($(compgen -W 'a b d e h i l rn t u x' -- "$cur")) + _comp_compgen -- -W 'a b d e h i l rn t u x' return fi diff --git a/completions/_adb b/completions/_adb index 6b0d66705b6..76c0c8e9c59 100644 --- a/completions/_adb +++ b/completions/_adb @@ -44,7 +44,7 @@ _comp_cmd_adb() tmp+=(devices connect disconnect sideload) fi ((${#tmp[@]})) && - COMPREPLY=($(compgen -W '"${tmp[@]}"' -- "$cur")) + _comp_compgen -- -W '"${tmp[@]}"' return fi @@ -62,7 +62,7 @@ _comp_cmd_adb() _parse_help -)' -- "$cur")) ;; reboot) - COMPREPLY=($(compgen -W 'bootloader recovery' -- "$cur")) + _comp_compgen -- -W 'bootloader recovery' ;; esac } && diff --git a/completions/_cal b/completions/_cal index 15e48f6d4b9..b58ad7a6437 100644 --- a/completions/_cal +++ b/completions/_cal @@ -11,7 +11,7 @@ _comp_cmd_cal() case $prev in -m) if [[ $OSTYPE == *bsd* ]]; then - COMPREPLY=($(compgen -W '{1..12}' -- "$cur")) + _comp_compgen -- -W '{1..12}' return fi ;; @@ -32,7 +32,7 @@ _comp_cmd_cal() local args _count_args - ((args == 1)) && COMPREPLY=($(compgen -W '{1..12}' -- "$cur")) + ((args == 1)) && _comp_compgen -- -W '{1..12}' } && complete -F _comp_cmd_cal cal ncal diff --git a/completions/_dmesg b/completions/_dmesg index 348aac1c127..68c1934c239 100644 --- a/completions/_dmesg +++ b/completions/_dmesg @@ -20,7 +20,7 @@ _comp_cmd_dmesg() return ;; -l | --level | -n | --console-level) - COMPREPLY=($(compgen -W '{1..8}' -- "$cur")) + _comp_compgen -- -W '{1..8}' return ;; esac diff --git a/completions/_eject b/completions/_eject index 7c3413dce2d..6985b8549c4 100644 --- a/completions/_eject +++ b/completions/_eject @@ -13,7 +13,7 @@ _comp_cmd_eject() return ;; -a | --auto | -i | --manualeject) - COMPREPLY=($(compgen -W 'on off' -- "$cur")) + _comp_compgen -- -W 'on off' return ;; esac diff --git a/completions/_ionice b/completions/_ionice index 66c2b3e8d80..980a7294956 100644 --- a/completions/_ionice +++ b/completions/_ionice @@ -37,11 +37,11 @@ _comp_cmd_ionice() case $prev in -c) - COMPREPLY=($(compgen -W '{0..3}' -- "$cur")) + _comp_compgen -- -W '{0..3}' return ;; -n) - COMPREPLY=($(compgen -W '{0..7}' -- "$cur")) + _comp_compgen -- -W '{0..7}' return ;; -p) diff --git a/completions/_mock b/completions/_mock index 6fe05e6254c..721c3ffe784 100644 --- a/completions/_mock +++ b/completions/_mock @@ -50,7 +50,7 @@ _comp_cmd_mock() return ;; --enable-plugin | --disable-plugin) - COMPREPLY=($(compgen -W "$plugins" -- "$cur")) + _comp_compgen -- -W "$plugins" return ;; esac diff --git a/completions/_modules b/completions/_modules index f35df6ac96f..6c72a35d700 100644 --- a/completions/_modules +++ b/completions/_modules @@ -60,7 +60,7 @@ _comp_cmd_module() options="$(module help 2>&1 | command grep -E '^[[:space:]]*\+' | awk '{print $2}' | command sed -e 's/|/ /g' | sort)" - COMPREPLY=($(compgen -W "$options" -- "$cur")) + _comp_compgen -- -W "$options" elif ((cword == 2)); then case $prev in diff --git a/completions/_nmcli b/completions/_nmcli index 5e8caaa1ad9..41d16257fa5 100644 --- a/completions/_nmcli +++ b/completions/_nmcli @@ -5,7 +5,7 @@ _comp_cmd_nmcli__list() { - COMPREPLY=($(compgen -W '$1' -- "$cur")) + _comp_compgen -- -W '$1' } _comp_cmd_nmcli__con_id() @@ -41,11 +41,11 @@ _comp_cmd_nmcli() case $prev in -m | --mode) - COMPREPLY=($(compgen -W 'tabular multiline' -- "$cur")) + _comp_compgen -- -W 'tabular multiline' return ;; -f | --fields) - COMPREPLY=($(compgen -W 'all common' -- "$cur")) + _comp_compgen -- -W 'all common' return ;; -e | --escape) @@ -79,7 +79,7 @@ _comp_cmd_nmcli() COMPREPLY=($(compgen -W '--terse --pretty --mode --fields --escape --version --help' -- "$cur")) else - COMPREPLY=($(compgen -W "nm con dev" -- "$cur")) + _comp_compgen -- -W "nm con dev" fi else local object=${words[1]} @@ -116,7 +116,7 @@ _comp_cmd_nmcli() con) case $command in list) - COMPREPLY=($(compgen -W 'id uuid' -- "$cur")) + _comp_compgen -- -W 'id uuid' return ;; up) @@ -130,11 +130,11 @@ _comp_cmd_nmcli() return ;; down) - COMPREPLY=($(compgen -W 'id uuid' -- "$cur")) + _comp_compgen -- -W 'id uuid' return ;; delete) - COMPREPLY=($(compgen -W 'id uuid' -- "$cur")) + _comp_compgen -- -W 'id uuid' return ;; esac @@ -145,7 +145,7 @@ _comp_cmd_nmcli() dev) case $command in list) - COMPREPLY=($(compgen -W 'iface' -- "$cur")) + _comp_compgen -- -W 'iface' return ;; disconnect) @@ -153,7 +153,7 @@ _comp_cmd_nmcli() COMPREPLY=($(compgen -W '--nowait --timeout' \ -- "$cur")) else - COMPREPLY=($(compgen -W 'iface' -- "$cur")) + _comp_compgen -- -W 'iface' fi return ;; @@ -183,7 +183,7 @@ _comp_cmd_nmcli() ;; esac - COMPREPLY=($(compgen -W 'list connect' -- "$cur")) + _comp_compgen -- -W 'list connect' return ;; esac diff --git a/completions/_rfkill b/completions/_rfkill index 0b370b5472f..5c40097757b 100644 --- a/completions/_rfkill +++ b/completions/_rfkill @@ -9,7 +9,7 @@ _comp_cmd_rfkill() _comp_initialize -- "$@" || return if [[ $cur == -* ]]; then - COMPREPLY=($(compgen -W '--version' -- "$cur")) + _comp_compgen -- -W '--version' else case $cword in 1) diff --git a/completions/_rtcwake b/completions/_rtcwake index cd977b9da5e..e8b56fa838c 100644 --- a/completions/_rtcwake +++ b/completions/_rtcwake @@ -13,13 +13,13 @@ _comp_cmd_rtcwake() return ;; --mode | -m) - COMPREPLY=($(compgen -W 'standby mem disk on no off' -- "$cur")) + _comp_compgen -- -W 'standby mem disk on no off' return ;; --device | -d) _comp_expand_glob COMPREPLY '/dev/rtc?*' ((${#COMPREPLY[@]})) && - COMPREPLY=($(compgen -W '"${COMPREPLY[@]#/dev/}"' -- "$cur")) + _comp_compgen -- -W '"${COMPREPLY[@]#/dev/}"' return ;; esac diff --git a/completions/_slackpkg b/completions/_slackpkg index 2bda234428c..5c02c6364ca 100644 --- a/completions/_slackpkg +++ b/completions/_slackpkg @@ -20,11 +20,11 @@ _comp_cmd_slackpkg() -delall | -checkmd5 | -checkgpg | -checksize | -postinst | -onoff | \ -download_all | -dialog | -batch | -only_new_dotnew | \ -use_includes | -spinning) - COMPREPLY=($(compgen -W 'on off' -- "$cur")) + _comp_compgen -- -W 'on off' return ;; -default_answer) - COMPREPLY=($(compgen -W 'yes no' -- "$cur")) + _comp_compgen -- -W 'yes no' return ;; -dialog_maxargs | -mirror) @@ -98,7 +98,7 @@ _comp_cmd_slackpkg() ;; update) # we should complete the same as the next `list` + "gpg" - COMPREPLY=($(compgen -W 'gpg' -- "$cur")) + _comp_compgen -- -W 'gpg' ;& *) COMPREPLY+=($(compgen -W 'install reinstall upgrade remove diff --git a/completions/_su b/completions/_su index 53838ec5f51..16a487adcc1 100644 --- a/completions/_su +++ b/completions/_su @@ -21,7 +21,7 @@ _comp_cmd_su() -c | --command | --session-command) local IFS=$'\n' compopt -o filenames - COMPREPLY=($(compgen -d -c -- "$cur")) + _comp_compgen -- -d -c return ;; esac @@ -34,7 +34,7 @@ _comp_cmd_su() return fi - COMPREPLY=($(compgen -u -- "$cur")) + _comp_compgen -- -u } && complete -F _comp_cmd_su su diff --git a/completions/_svn b/completions/_svn index dcfaf7d5b04..d860f6e654a 100644 --- a/completions/_svn +++ b/completions/_svn @@ -18,9 +18,9 @@ _comp_cmd_svn() if ((cword == 1)); then if [[ $cur == -* ]]; then - COMPREPLY=($(compgen -W '--version' -- "$cur")) + _comp_compgen -- -W '--version' else - COMPREPLY=($(compgen -W "$commands" -- "$cur")) + _comp_compgen -- -W "$commands" fi else @@ -39,7 +39,7 @@ _comp_cmd_svn() ;; --editor-cmd | --diff-cmd | --diff3-cmd) compopt -o filenames - COMPREPLY=($(compgen -c -- "$cur")) + _comp_compgen -- -c return ;; esac @@ -194,10 +194,10 @@ _comp_cmd_svn() esac options+=" --help --config-dir" - COMPREPLY=($(compgen -W "$options" -- "$cur")) + _comp_compgen -- -W "$options" else if [[ $command == @(help|[h?]) ]]; then - COMPREPLY=($(compgen -W "$commands" -- "$cur")) + _comp_compgen -- -W "$commands" else _comp_compgen_filedir fi diff --git a/completions/_svnadmin b/completions/_svnadmin index 11df0b754ca..6b4a423a9e7 100644 --- a/completions/_svnadmin +++ b/completions/_svnadmin @@ -14,9 +14,9 @@ _comp_cmd_svnadmin() if ((cword == 1)); then if [[ $cur == -* ]]; then - COMPREPLY=($(compgen -W '--version' -- "$cur")) + _comp_compgen -- -W '--version' else - COMPREPLY=($(compgen -W "$commands" -- "$cur")) + _comp_compgen -- -W "$commands" fi else case $prev in @@ -25,7 +25,7 @@ _comp_cmd_svnadmin() return ;; --fs-type) - COMPREPLY=($(compgen -W 'fsfs bdb' -- "$cur")) + _comp_compgen -- -W 'fsfs bdb' return ;; esac @@ -62,10 +62,10 @@ _comp_cmd_svnadmin() esac options+=" --help" - COMPREPLY=($(compgen -W "$options" -- "$cur")) + _comp_compgen -- -W "$options" else if [[ $command == @(help|[h?]) ]]; then - COMPREPLY=($(compgen -W "$commands" -- "$cur")) + _comp_compgen -- -W "$commands" else _comp_compgen_filedir fi diff --git a/completions/_svnlook b/completions/_svnlook index 4d23aff0d23..f0c01df9fbe 100644 --- a/completions/_svnlook +++ b/completions/_svnlook @@ -14,9 +14,9 @@ _comp_cmd_svnlook() if ((cword == 1)); then if [[ $cur == -* ]]; then - COMPREPLY=($(compgen -W '--version' -- "$cur")) + _comp_compgen -- -W '--version' else - COMPREPLY=($(compgen -W "$commands" -- "$cur")) + _comp_compgen -- -W "$commands" fi else local command=${words[1]} @@ -47,10 +47,10 @@ _comp_cmd_svnlook() esac options+=" --help" - COMPREPLY=($(compgen -W "$options" -- "$cur")) + _comp_compgen -- -W "$options" else if [[ $command == @(help|[h?]) ]]; then - COMPREPLY=($(compgen -W "$commands" -- "$cur")) + _comp_compgen -- -W "$commands" else _comp_compgen_filedir fi diff --git a/completions/_udevadm b/completions/_udevadm index da98c3bf32f..a2550ee33f9 100644 --- a/completions/_udevadm +++ b/completions/_udevadm @@ -25,7 +25,7 @@ _comp_cmd_udevadm() return ;; --log-priority) - COMPREPLY=($(compgen -W 'err info debug' -- "$cur")) + _comp_compgen -- -W 'err info debug' return ;; --query) @@ -42,11 +42,11 @@ _comp_cmd_udevadm() return ;; --action) - COMPREPLY=($(compgen -W 'add change remove' -- "$cur")) + _comp_compgen -- -W 'add change remove' return ;; --type) - COMPREPLY=($(compgen -W 'devices subsystems failed' -- "$cur")) + _comp_compgen -- -W 'devices subsystems failed' return ;; esac @@ -56,7 +56,7 @@ _comp_cmd_udevadm() if [[ ! $has_udevcmd ]]; then case $cur in -*) - COMPREPLY=($(compgen -W '--help --version --debug' -- "$cur")) + _comp_compgen -- -W '--help --version --debug' ;; *) COMPREPLY=($(compgen -W "$("$1" --help 2>/dev/null | diff --git a/completions/_xm b/completions/_xm index 785daa625fe..6425b469992 100644 --- a/completions/_xm +++ b/completions/_xm @@ -31,7 +31,7 @@ _comp_cmd_xm() resetpolicy getpolicy shell help' if ((cword == 1)); then - COMPREPLY=($(compgen -W "$commands" -- "$cur")) + _comp_compgen -- -W "$commands" else if [[ $cur == *=* ]]; then prev=${cur/=*/} @@ -72,7 +72,7 @@ _comp_cmd_xm() -s --skipdtd -p --paused -c --console_autoconnect' ;; esac - COMPREPLY=($(compgen -W "$options" -- "$cur")) + _comp_compgen -- -W "$options" else case $command in console | destroy | domname | domid | list | mem-set | \ @@ -118,7 +118,7 @@ _comp_cmd_xm() _comp_cmd_xm__domain_names ;; 3) - COMPREPLY=($(compgen -W "r s e i u b" -- "$cur")) + _comp_compgen -- -W "r s e i u b" ;; esac ;; @@ -129,10 +129,10 @@ _comp_cmd_xm() _comp_cmd_xm__domain_names ;; 3) - COMPREPLY=($(compgen -W "phy: file:" -- "$cur")) + _comp_compgen -- -W "phy: file:" ;; 5) - COMPREPLY=($(compgen -W "w r" -- "$cur")) + _comp_compgen -- -W "w r" ;; 6) _comp_cmd_xm__domain_names diff --git a/completions/_yum b/completions/_yum index 31cbddf5b64..70611e58ac1 100644 --- a/completions/_yum +++ b/completions/_yum @@ -90,14 +90,14 @@ _comp_cmd_yum() all' -- "$cur")) ;; repolist) - COMPREPLY=($(compgen -W 'all enabled disabled' -- "$cur")) + _comp_compgen -- -W 'all enabled disabled' ;; localinstall | localupdate) # TODO: should not match *src.rpm _comp_compgen_filedir rpm ;; -d | -e) - COMPREPLY=($(compgen -W '{0..10}' -- "$cur")) + _comp_compgen -- -W '{0..10}' ;; -c) _comp_compgen_filedir @@ -119,7 +119,7 @@ _comp_cmd_yum() COMPREPLY=($(compgen -W '$(_yum_plugins)' -- "$cur")) ;; --color) - COMPREPLY=($(compgen -W 'always auto never' -- "$cur")) + _comp_compgen -- -W 'always auto never' ;; -R | -x | --exclude) # argument required but no completions available diff --git a/completions/abook b/completions/abook index b50f640c80d..e5128d3b867 100644 --- a/completions/abook +++ b/completions/abook @@ -32,11 +32,11 @@ _comp_cmd_abook() -- "$cur")) ;; --infile) - COMPREPLY=($(compgen -W stdin -- "$cur")) + _comp_compgen -- -W stdin _comp_compgen -a filedir ;; --outfile) - COMPREPLY=($(compgen -W stdout -- "$cur")) + _comp_compgen -- -W stdout _comp_compgen -a filedir ;; --config | --datafile) diff --git a/completions/add_members b/completions/add_members index aba81c28b91..4b40dd8d633 100644 --- a/completions/add_members +++ b/completions/add_members @@ -11,7 +11,7 @@ _comp_cmd_add_members() return ;; -w | -a | --welcome-msg | --admin-notify) - COMPREPLY=($(compgen -W 'y n' -- "$cur")) + _comp_compgen -- -W 'y n' return ;; esac diff --git a/completions/alias b/completions/alias index 163c6e58aa1..3db2ed82f9d 100644 --- a/completions/alias +++ b/completions/alias @@ -10,7 +10,7 @@ _comp_cmd_alias() return ;; *[^=]) - COMPREPLY=($(compgen -A alias -- "$cur")) + _comp_compgen -- -A alias ;; *=) COMPREPLY=("$(alias "${cur%=}" 2>/dev/null | command sed \ diff --git a/completions/ant b/completions/ant index 0caabc2b901..9b6201c6b89 100644 --- a/completions/ant +++ b/completions/ant @@ -47,7 +47,7 @@ _comp_cmd_ant() return ;; -nice) - COMPREPLY=($(compgen -W '{1..10}' -- "$cur")) + _comp_compgen -- -W '{1..10}' return ;; -lib) @@ -92,7 +92,7 @@ _comp_cmd_ant() # fill targets _comp_cmd_ant__targets "$buildfile" - COMPREPLY=($(compgen -W '"${ret[@]}"' -- "$cur")) + _comp_compgen -- -W '"${ret[@]}"' fi } && complete -F _comp_cmd_ant ant phing diff --git a/completions/apache2ctl b/completions/apache2ctl index 41d99235760..baf78afd790 100644 --- a/completions/apache2ctl +++ b/completions/apache2ctl @@ -9,7 +9,7 @@ _comp_cmd_apache2ctl() APWORDS=$("$1" 2>&1 >/dev/null | awk 'NR<2 { print $3; exit }' | tr "|" " ") - COMPREPLY=($(compgen -W "$APWORDS" -- "$cur")) + _comp_compgen -- -W "$APWORDS" } && complete -F _comp_cmd_apache2ctl apache2ctl diff --git a/completions/aptitude b/completions/aptitude index b30d4d32ccd..f05f915173a 100644 --- a/completions/aptitude +++ b/completions/aptitude @@ -108,7 +108,7 @@ _comp_cmd_aptitude() done ((${#COMPREPLY[@]})) && - COMPREPLY=($(compgen -W '"${COMPREPLY[@]}"' -- "$cur")) + _comp_compgen -- -W '"${COMPREPLY[@]}"' else COMPREPLY=($(compgen -W 'update upgrade safe-upgrade forget-new clean autoclean install reinstall remove hold unhold purge markauto diff --git a/completions/arch b/completions/arch index 19b418b1234..ee84a4d4f05 100644 --- a/completions/arch +++ b/completions/arch @@ -10,7 +10,7 @@ _comp_have_command mailmanctl && case $prev in -w | -g | -d | --welcome-msg | --goodbye-msg | --digest) - COMPREPLY=($(compgen -W 'y n' -- "$cur")) + _comp_compgen -- -W 'y n' return ;; --file) diff --git a/completions/arp b/completions/arp index 4492d6f40dc..903fd152406 100644 --- a/completions/arp +++ b/completions/arp @@ -41,7 +41,7 @@ _comp_cmd_arp() 1) local ips=$("$1" -an | command sed -ne \ 's/.*(\([0-9]\{1,3\}\(\.[0-9]\{1,3\}\)\{3\}\)).*/\1/p') - COMPREPLY=($(compgen -W '$ips' -- "$cur")) + _comp_compgen -- -W '$ips' ;; 2) # TODO if -d mode: "pub"; if not -f mode: hw_addr diff --git a/completions/asciidoc b/completions/asciidoc index 51ec738b8d6..0590e28d1b3 100644 --- a/completions/asciidoc +++ b/completions/asciidoc @@ -19,7 +19,7 @@ _comp_cmd_asciidoc() return ;; --backend | -${noargopts}b) - COMPREPLY=($(compgen -W 'docbook html4 xhtml11' -- "$cur")) + _comp_compgen -- -W 'docbook html4 xhtml11' return ;; --conf-file | -${noargopts}f) @@ -31,7 +31,7 @@ _comp_cmd_asciidoc() return ;; --help | -${noargopts}h) - COMPREPLY=($(compgen -W 'manpage syntax topics' -- "$cur")) + _comp_compgen -- -W 'manpage syntax topics' return ;; --out-file | -${noargopts}o) diff --git a/completions/aspell b/completions/aspell index f10c11f5729..0e7bd132eb3 100644 --- a/completions/aspell +++ b/completions/aspell @@ -13,7 +13,7 @@ _comp_cmd_aspell__dictionary() # Then, add the canonical dicts COMPREPLY+=($("$aspell" dicts 2>/dev/null)) ((${#COMPREPLY[@]})) && - COMPREPLY=($(compgen -X '\*' -W '"${COMPREPLY[@]}"' -- "$cur")) + _comp_compgen -- -X '\*' -W '"${COMPREPLY[@]}"' } _comp_cmd_aspell() @@ -31,7 +31,7 @@ _comp_cmd_aspell() return ;; dump | create | merge) - COMPREPLY=($(compgen -W 'master personal repl' -- "$cur")) + _comp_compgen -- -W 'master personal repl' return ;; --mode) @@ -45,7 +45,7 @@ _comp_cmd_aspell() return ;; --keymapping) - COMPREPLY=($(compgen -W 'aspell ispell' -- "$cur")) + _comp_compgen -- -W 'aspell ispell' return ;; -d | --master) diff --git a/completions/avctrl b/completions/avctrl index 20e1fb2be6b..f503bd67f22 100644 --- a/completions/avctrl +++ b/completions/avctrl @@ -6,12 +6,12 @@ _comp_cmd_avctrl() _comp_initialize -- "$@" || return if [[ $cur == -* ]]; then - COMPREPLY=($(compgen -W '--help --quiet' -- "$cur")) + _comp_compgen -- -W '--help --quiet' else local args _count_args if ((args == 1)); then - COMPREPLY=($(compgen -W 'discover switch' -- "$cur")) + _comp_compgen -- -W 'discover switch' fi fi } && diff --git a/completions/bind b/completions/bind index ffe168c8bf9..3de541f7d37 100644 --- a/completions/bind +++ b/completions/bind @@ -29,7 +29,7 @@ _comp_cmd_bind() return fi - COMPREPLY=($(compgen -A binding -- "$cur")) + _comp_compgen -- -A binding } && complete -F _comp_cmd_bind bind diff --git a/completions/bk b/completions/bk index 19ed62ee64c..77acc07777c 100644 --- a/completions/bk +++ b/completions/bk @@ -9,7 +9,7 @@ _comp_cmd_bk() local BKCMDS="$(bk help topics 2>/dev/null | awk '/^ bk/ { print $2 }' | xargs printf '%s ')" - COMPREPLY=($(compgen -W "$BKCMDS" -- "$cur")) + _comp_compgen -- -W "$BKCMDS" _comp_compgen -a filedir } && diff --git a/completions/brctl b/completions/brctl index 63d4a020997..4c066d21241 100644 --- a/completions/brctl +++ b/completions/brctl @@ -29,7 +29,7 @@ _comp_cmd_brctl() _configured_interfaces ;; stp) - COMPREPLY=($(compgen -W 'on off' -- "$cur")) + _comp_compgen -- -W 'on off' ;; esac ;; diff --git a/completions/bts b/completions/bts index ec15b1e09da..23cb5e09b3f 100644 --- a/completions/bts +++ b/completions/bts @@ -43,7 +43,7 @@ _comp_cmd_bts() return ;; block | unblock) - COMPREPLY=($(compgen -W 'by with' -- "$cur")) + _comp_compgen -- -W 'by with' return ;; severity) diff --git a/completions/cancel b/completions/cancel index c1b47825bea..ab07318d96d 100644 --- a/completions/cancel +++ b/completions/cancel @@ -14,7 +14,7 @@ _comp_cmd_cancel() return ;; -u) - COMPREPLY=($(compgen -u -- "$cur")) + _comp_compgen -- -u return ;; esac diff --git a/completions/ccze b/completions/ccze index 9d917521ae9..6438c81fc3e 100644 --- a/completions/ccze +++ b/completions/ccze @@ -20,12 +20,12 @@ _comp_cmd_ccze() return ;; --mode | -${noargopts}m) - COMPREPLY=($(compgen -W "curses ansi html" -- "$cur")) + _comp_compgen -- -W "curses ansi html" return ;; --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 | -${noargopts}p) diff --git a/completions/cfrun b/completions/cfrun index 3d47456221e..6b16056b28e 100644 --- a/completions/cfrun +++ b/completions/cfrun @@ -22,7 +22,7 @@ _comp_cmd_cfrun() esac if [[ $cur == -* ]]; then - COMPREPLY=($(compgen -W '-f -h -d -S -T -v' -- "$cur")) + _comp_compgen -- -W '-f -h -d -S -T -v' else local hostfile=${CFINPUTS:-/var/lib/cfengine/inputs}/cfrun.hosts for ((i = 1; i < cword; i++)); do diff --git a/completions/chage b/completions/chage index 80250d3523b..b9268e6df1c 100644 --- a/completions/chage +++ b/completions/chage @@ -25,7 +25,7 @@ _comp_cmd_chage() return fi - COMPREPLY=($(compgen -u -- "$cur")) + _comp_compgen -- -u } && complete -F _comp_cmd_chage chage diff --git a/completions/check_db b/completions/check_db index 587c82340fb..745f34222b3 100644 --- a/completions/check_db +++ b/completions/check_db @@ -6,7 +6,7 @@ _comp_cmd_check_db() _comp_initialize -- "$@" || return if [[ $cur == -* ]]; then - COMPREPLY=($(compgen -W '--all --verbose --help' -- "$cur")) + _comp_compgen -- -W '--all --verbose --help' else _comp_xfunc list_lists mailman_lists fi diff --git a/completions/check_perms b/completions/check_perms index c30c96cd0f2..0ff1ffdf530 100644 --- a/completions/check_perms +++ b/completions/check_perms @@ -6,7 +6,7 @@ _comp_cmd_check_perms() _comp_initialize -- "$@" || return if [[ $cur == -* ]]; then - COMPREPLY=($(compgen -W '-f -v -h' -- "$cur")) + _comp_compgen -- -W '-f -v -h' fi } && diff --git a/completions/chkconfig b/completions/chkconfig index 59619707674..9c2a0e5fbb4 100644 --- a/completions/chkconfig +++ b/completions/chkconfig @@ -12,7 +12,7 @@ _comp_cmd_chkconfig() return ;; --level) - COMPREPLY=($(compgen -W '{1..6}' -- "$cur")) + _comp_compgen -- -W '{1..6}' return ;; esac diff --git a/completions/chromium-browser b/completions/chromium-browser index 4f0d02d8598..a0c4b769134 100644 --- a/completions/chromium-browser +++ b/completions/chromium-browser @@ -23,13 +23,13 @@ _comp_cmd_chromium_browser() ;; *) compopt -o nospace - COMPREPLY=($(compgen -S :// -W 'http socks socks4 socks5' -- "$cur")) + _comp_compgen -- -S :// -W 'http socks socks4 socks5' ;; esac return ;; --password-store) - COMPREPLY=($(compgen -W 'basic gnome kwallet' -- "$cur")) + _comp_compgen -- -W 'basic gnome kwallet' return ;; esac diff --git a/completions/chronyc b/completions/chronyc index c60b2d8f4fe..878257578d5 100644 --- a/completions/chronyc +++ b/completions/chronyc @@ -49,7 +49,7 @@ _comp_cmd_chronyc() _comp_cmd_chronyc__command_args "$1" if [[ ! ${COMPREPLY-} && $prev == sources?(tats) ]]; then # [-v] not handled by _comp_cmd_chronyc__command_args yet - COMPREPLY=($(compgen -W '-v' -- "$cur")) + _comp_compgen -- -W '-v' fi ;; 2) diff --git a/completions/complete b/completions/complete index 0e3f9d77162..e67ed272296 100644 --- a/completions/complete +++ b/completions/complete @@ -21,17 +21,17 @@ _comp_cmd_complete() ;; -*C) - COMPREPLY=($(compgen -A command -- "$cur")) + _comp_compgen -- -A command return ;; -*F) - COMPREPLY=($(compgen -A function -- "$cur")) + _comp_compgen -- -A function return ;; -*p | -*r) COMPREPLY=($(complete -p | command sed -e 's|.* ||')) ((${#COMPREPLY[@]})) && - COMPREPLY=($(compgen -W '"${COMPREPLY[@]}"' -- "$cur")) + _comp_compgen -- -W '"${COMPREPLY[@]}"' return ;; esac @@ -40,9 +40,9 @@ _comp_cmd_complete() local -a opts=($(compgen -W '$(_parse_usage help "-s $1")' -- "$cur")) # -F, -C do not work the expected way with compgen [[ $1 != *compgen ]] || opts=("${opts[@]//-[FC]/}") - COMPREPLY=($(compgen -W '"${opts[@]}"' -X '' -- "$cur")) + _comp_compgen -- -W '"${opts[@]}"' -X '' else - COMPREPLY=($(compgen -A command -- "$cur")) + _comp_compgen -- -A command fi } && complete -F _comp_cmd_complete compgen complete diff --git a/completions/convert b/completions/convert index 7a66a7b5eea..45acf8d92ab 100644 --- a/completions/convert +++ b/completions/convert @@ -9,7 +9,7 @@ _comp_cmd_convert__common_options() return ;; -colormap) - COMPREPLY=($(compgen -W 'shared private' -- "$cur")) + _comp_compgen -- -W 'shared private' return ;; -colorspace) @@ -40,7 +40,7 @@ _comp_cmd_convert__common_options() return ;; -endian) - COMPREPLY=($(compgen -W 'MSB LSB' -- "$cur")) + _comp_compgen -- -W 'MSB LSB' return ;; -filter) @@ -66,11 +66,11 @@ _comp_cmd_convert__common_options() return ;; -interlace) - COMPREPLY=($(compgen -W 'None Line Plane Partition' -- "$cur")) + _comp_compgen -- -W 'None Line Plane Partition' return ;; -limit) - COMPREPLY=($(compgen -W 'Disk File Map Memory' -- "$cur")) + _comp_compgen -- -W 'Disk File Map Memory' return ;; -list) @@ -113,7 +113,7 @@ _comp_cmd_convert__common_options() return ;; -virtual-pixel) - COMPREPLY=($(compgen -W 'Constant Edge mirror tile' -- "$cur")) + _comp_compgen -- -W 'Constant Edge mirror tile' return ;; -visual) @@ -210,7 +210,7 @@ _comp_cmd_identify() if [[ $cur == -* ]]; then COMPREPLY=($(compgen -W '$(_parse_help "$1" -help)' -- "$cur")) elif [[ $cur == +* ]]; then - COMPREPLY=($(compgen -W '+debug' -- "$cur")) + _comp_compgen -- -W '+debug' else _comp_compgen_filedir fi @@ -263,7 +263,7 @@ _comp_cmd_compare() if [[ $cur == -* ]]; then COMPREPLY=($(compgen -W '$(_parse_help "$1" -help)' -- "$cur")) elif [[ $cur == +* ]]; then - COMPREPLY=($(compgen -W '+debug' -- "$cur")) + _comp_compgen -- -W '+debug' else _comp_compgen_filedir fi @@ -280,7 +280,7 @@ _comp_cmd_conjure() if [[ $cur == -* ]]; then COMPREPLY=($(compgen -W '$(_parse_help "$1" -help)' -- "$cur")) elif [[ $cur == +* ]]; then - COMPREPLY=($(compgen -W '+debug' -- "$cur")) + _comp_compgen -- -W '+debug' else _comp_compgen_filedir fi @@ -297,7 +297,7 @@ _comp_cmd_import() if [[ $cur == -* ]]; then COMPREPLY=($(compgen -W '$(_parse_help "$1" -help)' -- "$cur")) elif [[ $cur == +* ]]; then - COMPREPLY=($(compgen -W '+debug' -- "$cur")) + _comp_compgen -- -W '+debug' else _comp_compgen_filedir fi @@ -314,7 +314,7 @@ _comp_cmd_stream() if [[ $cur == -* ]]; then COMPREPLY=($(compgen -W '$(_parse_help "$1" -help)' -- "$cur")) elif [[ $cur == +* ]]; then - COMPREPLY=($(compgen -W '+debug' -- "$cur")) + _comp_compgen -- -W '+debug' else _comp_compgen_filedir fi diff --git a/completions/cpio b/completions/cpio index 777da487bff..19fa58f2530 100644 --- a/completions/cpio +++ b/completions/cpio @@ -24,7 +24,7 @@ _comp_cmd_cpio() ;; --rsh-command) compopt -o filenames - COMPREPLY=($(compgen -c -- "$cur")) + _comp_compgen -- -c return ;; esac diff --git a/completions/cppcheck b/completions/cppcheck index 80233c7d3b1..13d762db244 100644 --- a/completions/cppcheck +++ b/completions/cppcheck @@ -30,7 +30,7 @@ _comp_cmd_cppcheck() return ;; --error-exitcode) - COMPREPLY=($(compgen -W '{0..255}' -- "$cur")) + _comp_compgen -- -W '{0..255}' return ;; --file-list) @@ -47,7 +47,7 @@ _comp_cmd_cppcheck() return ;; --language | -x) - COMPREPLY=($(compgen -W 'c c++' -- "$cur")) + _comp_compgen -- -W 'c c++' return ;; --std) @@ -72,7 +72,7 @@ _comp_cmd_cppcheck() return ;; --xml-version) - COMPREPLY=($(compgen -W '1 2' -- "$cur")) + _comp_compgen -- -W '1 2' return ;; esac diff --git a/completions/crontab b/completions/crontab index 8e27e7bfe12..73867019147 100644 --- a/completions/crontab +++ b/completions/crontab @@ -36,7 +36,7 @@ _comp_cmd_crontab() done if [[ $cur == -* ]]; then - COMPREPLY=($(compgen -W '"${!opts[@]}"' -- "$cur")) + _comp_compgen -- -W '"${!opts[@]}"' return fi diff --git a/completions/cryptsetup b/completions/cryptsetup index 2acd52f5e71..124232d71af 100644 --- a/completions/cryptsetup +++ b/completions/cryptsetup @@ -27,7 +27,7 @@ _comp_cmd_cryptsetup() return ;; --type | -${noargopts}M) - COMPREPLY=($(compgen -W "luks plain loopaes tcrypt" -- "$cur")) + _comp_compgen -- -W "luks plain loopaes tcrypt" return ;; esac diff --git a/completions/curl b/completions/curl index 086e7ad9f96..0a8bc3763c1 100644 --- a/completions/curl +++ b/completions/curl @@ -43,7 +43,7 @@ _comp_cmd_curl() return ;; --cert-type | --key-type | --proxy-cert-type | --proxy-key-type) - COMPREPLY=($(compgen -W 'DER PEM ENG' -- "$cur")) + _comp_compgen -- -W 'DER PEM ENG' return ;; --crlfile | --proxy-crlfile) @@ -63,7 +63,7 @@ _comp_cmd_curl() return ;; --delegation) - COMPREPLY=($(compgen -W 'none policy always' -- "$cur")) + _comp_compgen -- -W 'none policy always' return ;; --dns-ipv[46]-addr) @@ -81,7 +81,7 @@ _comp_cmd_curl() "$1" --engine list 2>/dev/null | command grep "^[[:space:]]" ) - COMPREPLY=($(compgen -W '$engines list' -- "$cur")) + _comp_compgen -- -W '$engines list' return ;; --ftp-port | -${noargopts}P) @@ -91,11 +91,11 @@ _comp_cmd_curl() return ;; --ftp-method) - COMPREPLY=($(compgen -W 'multicwd nocwd singlecwd' -- "$cur")) + _comp_compgen -- -W 'multicwd nocwd singlecwd' return ;; --ftp-ssl-ccc-mode) - COMPREPLY=($(compgen -W 'active passive' -- "$cur")) + _comp_compgen -- -W 'active passive' return ;; --interface) @@ -112,12 +112,12 @@ _comp_cmd_curl() # Looks like an option? Likely no --help category support [[ $x != -* ]] || return done - COMPREPLY=($(compgen -W '"${categories[@]}"' -- "$cur")) + _comp_compgen -- -W '"${categories[@]}"' fi return ;; --krb) - COMPREPLY=($(compgen -W 'clear safe confidential private' -- "$cur")) + _comp_compgen -- -W 'clear safe confidential private' return ;; --pinnedpubkey | --proxy-pinnedpubkey) @@ -143,16 +143,16 @@ _comp_cmd_curl() return ;; --stderr) - COMPREPLY=($(compgen -W '-' -- "$cur")) + _comp_compgen -- -W '-' _comp_compgen -a filedir return ;; --tls-max) - COMPREPLY=($(compgen -W 'default 1.0 1.1 1.2 1.3' -- "$cur")) + _comp_compgen -- -W 'default 1.0 1.1 1.2 1.3' return ;; --tlsauthtype | --proxy-tlsauthtype) - COMPREPLY=($(compgen -W 'SRP' -- "$cur")) + _comp_compgen -- -W 'SRP' return ;; esac diff --git a/completions/cvs b/completions/cvs index 45810582c56..eaed78759ee 100644 --- a/completions/cvs +++ b/completions/cvs @@ -34,7 +34,7 @@ _comp_cmd_cvs__command_options() _comp_cmd_cvs__kflags() { - COMPREPLY=($(compgen -W 'kv kvl k o b v' -- "$cur")) + _comp_compgen -- -W 'kv kvl k o b v' } _comp_xfunc_cvs_roots() @@ -44,7 +44,7 @@ _comp_xfunc_cvs_roots() [[ -r ~/.cvspass ]] && cvsroots+=($(awk '{ print $2 }' ~/.cvspass)) [[ -r CVS/Root ]] && mapfile -tO ${#cvsroots[@]} cvsroots /dev/null | awk '{print $1}')) ((${#COMPREPLY[@]})) && - COMPREPLY=($(compgen -W '"${COMPREPLY[@]}"' -- "$cur")) + _comp_compgen -- -W '"${COMPREPLY[@]}"' else _comp_cmd_cvs__command_options "$1" "$mode" fi @@ -270,11 +270,11 @@ _comp_cmd_cvs() ((${#changed[@]})) && COMPREPLY+=("${changed[@]}") ((${#newremoved[@]})) && COMPREPLY+=("${newremoved[@]}") ((${#COMPREPLY[@]})) && - COMPREPLY=($(compgen -W '"${COMPREPLY[@]}"' -- "$cur")) + _comp_compgen -- -W '"${COMPREPLY[@]}"' else _cvs_entries ((${#entries[@]})) && - COMPREPLY=($(compgen -W '"${entries[@]}"' -- "$cur")) + _comp_compgen -- -W '"${entries[@]}"' fi else _comp_cmd_cvs__command_options "$1" "$mode" @@ -290,7 +290,7 @@ _comp_cmd_cvs() else _cvs_entries ((${#entries[@]})) && - COMPREPLY=($(compgen -W '"${entries[@]}"' -- "$cur")) + _comp_compgen -- -W '"${entries[@]}"' fi ;; editors | watchers) @@ -299,7 +299,7 @@ _comp_cmd_cvs() else _cvs_entries ((${#entries[@]})) && - COMPREPLY=($(compgen -W '"${entries[@]}"' -- "$cur")) + _comp_compgen -- -W '"${entries[@]}"' fi ;; export) @@ -322,7 +322,7 @@ _comp_cmd_cvs() [[ ! $has_cvsroot ]] && cvsroot=${CVSROOT-} COMPREPLY=($(cvs -d "$cvsroot" co -c | awk '{print $1}')) ((${#COMPREPLY[@]})) && - COMPREPLY=($(compgen -W '"${COMPREPLY[@]}"' -- "$cur")) + _comp_compgen -- -W '"${COMPREPLY[@]}"' else _comp_cmd_cvs__command_options "$1" "$mode" fi @@ -352,7 +352,7 @@ _comp_cmd_cvs() pwd=${pwd##*/} [[ $pwd ]] && COMPREPLY+=("$pwd") ((${#COMPREPLY[@]})) && - COMPREPLY=($(compgen -W '"${COMPREPLY[@]}"' -- "$cur")) + _comp_compgen -- -W '"${COMPREPLY[@]}"' else _comp_cmd_cvs__command_options "$1" "$mode" fi @@ -367,7 +367,7 @@ _comp_cmd_cvs() done fi ((${#entries[@]})) && - COMPREPLY=($(compgen -W '"${entries[@]}"' -- "$cur")) + _comp_compgen -- -W '"${entries[@]}"' else _comp_cmd_cvs__command_options "$1" "$mode" fi @@ -389,7 +389,7 @@ _comp_cmd_cvs() else _cvs_entries ((${#entries[@]})) && - COMPREPLY=($(compgen -W '"${entries[@]}"' -- "$cur")) + _comp_compgen -- -W '"${entries[@]}"' fi ;; "") @@ -403,7 +403,7 @@ _comp_cmd_cvs() return ;; -*z) - COMPREPLY=($(compgen -W '{1..9}' -- "$cur")) + _comp_compgen -- -W '{1..9}' return ;; esac diff --git a/completions/cvsps b/completions/cvsps index 429d51b65e1..77aa26daf0b 100644 --- a/completions/cvsps +++ b/completions/cvsps @@ -38,7 +38,7 @@ _comp_cmd_cvsps() return ;; -Z) - COMPREPLY=($(compgen -W '{1..9}' -- "$cur")) + _comp_compgen -- -W '{1..9}' return ;; --root) diff --git a/completions/dd b/completions/dd index e641310dceb..03b31702dfe 100644 --- a/completions/dd +++ b/completions/dd @@ -26,7 +26,7 @@ _comp_cmd_dd() ;; status=*) cur=${cur#*=} - COMPREPLY=($(compgen -W 'none noxfer progress' -- "$cur")) + _comp_compgen -- -W 'none noxfer progress' return ;; esac diff --git a/completions/declare b/completions/declare index 6c3b94503be..03616852d41 100644 --- a/completions/declare +++ b/completions/declare @@ -11,7 +11,7 @@ _comp_cmd_declare() # Most options also have a '+' form. # We'll exclude the ones that don't with compgen. opts+=(${opts[*]/-/+}) - COMPREPLY=($(compgen -W "${opts[*]}" -X '+[Ffgp]' -- "$cur")) + _comp_compgen -- -W "${opts[*]}" -X '+[Ffgp]' return fi @@ -19,11 +19,11 @@ _comp_cmd_declare() while [[ ${words[i]} == [-+]* ]]; do case ${words[i]} in -*[aA]*) - COMPREPLY=($(compgen -A arrayvar -- "$cur")) + _comp_compgen -- -A arrayvar return ;; -*[fF]*) - COMPREPLY=($(compgen -A function -- "$cur")) + _comp_compgen -- -A function return ;; esac @@ -33,7 +33,7 @@ _comp_cmd_declare() # There was at least one option and it was not one that limited # operations to functions and array variables _comp_variable_assignments "$cur" && return - COMPREPLY=($(compgen -A variable -- "$cur")) + _comp_compgen -- -A variable fi } && complete -F _comp_cmd_declare declare typeset diff --git a/completions/dhclient b/completions/dhclient index 22260a902ec..9a907441f86 100644 --- a/completions/dhclient +++ b/completions/dhclient @@ -10,7 +10,7 @@ _comp_cmd_dhclient() return ;; -D) - COMPREPLY=($(compgen -W 'LL LLT' -- "$cur")) + _comp_compgen -- -W 'LL LLT' return ;; -*f) diff --git a/completions/dnssec-keygen b/completions/dnssec-keygen index 437771454b6..21097ea3f75 100644 --- a/completions/dnssec-keygen +++ b/completions/dnssec-keygen @@ -31,7 +31,7 @@ _comp_cmd_dnssec_keygen() return ;; -v) - COMPREPLY=($(compgen -W '{0..10}' -- "$cur")) + _comp_compgen -- -W '{0..10}' return ;; esac diff --git a/completions/dpkg b/completions/dpkg index 69853870a6a..d66c8d4b2e4 100644 --- a/completions/dpkg +++ b/completions/dpkg @@ -86,7 +86,7 @@ _comp_cmd_dpkg() return ;; --debug | -${noargopts}D) - COMPREPLY=($(compgen -W 'help' -- "$cur")) + _comp_compgen -- -W 'help' return ;; --ignore-depends) @@ -104,11 +104,11 @@ _comp_cmd_dpkg() return ;; --status-logger) - COMPREPLY=($(compgen -c -- "$cur")) + _comp_compgen -- -c return ;; --verify-format) - COMPREPLY=($(compgen -W 'rpm' -- "$cur")) + _comp_compgen -- -W 'rpm' return ;; esac @@ -139,12 +139,12 @@ _comp_cmd_dpkg_reconfigure() if ((${#opt[@]})); then opt=("${opt[@]##*/}") opt=("${opt[@]%.pm}") - COMPREPLY=($(compgen -W '"${opt[@]}"' -- "$cur")) + _comp_compgen -- -W '"${opt[@]}"' fi return ;; --priority | -${noargopts}p) - COMPREPLY=($(compgen -W 'low medium high critical' -- "$cur")) + _comp_compgen -- -W 'low medium high critical' return ;; esac diff --git a/completions/dpkg-source b/completions/dpkg-source index d3fe53eb28a..ce7c7435f0c 100644 --- a/completions/dpkg-source +++ b/completions/dpkg-source @@ -32,7 +32,7 @@ _comp_cmd_dpkg_source() _comp_compgen_filedir 'dsc' ;; *) - COMPREPLY=($(compgen -W "$unpackopts" -- "$cur")) + _comp_compgen -- -W "$unpackopts" _comp_compgen -a filedir ;; esac @@ -69,13 +69,13 @@ _comp_cmd_dpkg_source() # $cur contains a "=" COMPREPLY=() else - COMPREPLY=($(compgen -W "$fields" -- "$cur")) + _comp_compgen -- -W "$fields" fi ;; -U) # -U: remove a field # Suggest possible fieldnames - COMPREPLY=($(compgen -W "$fields" -- "$cur")) + _comp_compgen -- -W "$fields" ;; *) COMPREPLY=($(compgen -W "$packopts $unpackopts" \ @@ -85,7 +85,7 @@ _comp_cmd_dpkg_source() return ;; *) - COMPREPLY=($(compgen -W "$options" -- "$cur")) + _comp_compgen -- -W "$options" return ;; esac diff --git a/completions/ebtables b/completions/ebtables index 4d0ed6c1d13..f3063af2617 100644 --- a/completions/ebtables +++ b/completions/ebtables @@ -20,7 +20,7 @@ _comp_cmd_ebtables() command sed -ne "$chain"`' -- "$cur")) ;; -${noargopts}t) - COMPREPLY=($(compgen -W 'nat filter broute' -- "$cur")) + _comp_compgen -- -W 'nat filter broute' ;; -${noargopts}j) if [[ $table == "filter" || ! $table ]]; then diff --git a/completions/ecryptfs-migrate-home b/completions/ecryptfs-migrate-home index 9f69e8825b2..476625eca27 100644 --- a/completions/ecryptfs-migrate-home +++ b/completions/ecryptfs-migrate-home @@ -10,7 +10,7 @@ _comp_cmd_ecryptfs_migrate_home() return ;; --user | -u) - COMPREPLY=($(compgen -u -- "$cur")) + _comp_compgen -- -u return ;; esac diff --git a/completions/export b/completions/export index f4f3940284d..b9035cf3dbf 100644 --- a/completions/export +++ b/completions/export @@ -54,7 +54,7 @@ _comp_cmd_export() suffix="=" compopt -o nospace fi - COMPREPLY=($(compgen -A $action -S "$suffix" -- "$cur")) + _comp_compgen -- -A $action -S "$suffix" ;; esac } && diff --git a/completions/faillog b/completions/faillog index 529200b3d5b..56fd5d804d1 100644 --- a/completions/faillog +++ b/completions/faillog @@ -12,7 +12,7 @@ _comp_cmd_faillog() return ;; --user | -${noargopts}u) - COMPREPLY=($(compgen -u -- "$cur")) + _comp_compgen -- -u return ;; esac diff --git a/completions/feh b/completions/feh index 9a86c954061..3f2d2813181 100644 --- a/completions/feh +++ b/completions/feh @@ -9,7 +9,7 @@ _comp_cmd_feh() # shellcheck disable=SC2254 case "$prev" in --image-bg | -B) - COMPREPLY=($(compgen -W 'checks white black' -- "$cur")) + _comp_compgen -- -W 'checks white black' return ;; --filelist | --output | --output-only | --start-at | -${noargopts}[foO\|]) @@ -70,7 +70,7 @@ _comp_cmd_feh() ;; --zoom) # expect integer value or "max", "fill" - COMPREPLY=($(compgen -W 'max fill' -- "$cur")) + _comp_compgen -- -W 'max fill' if [[ ! $cur || ! ${COMPREPLY-} ]]; then COMPREPLY+=($(compgen -W '{0..9}')) compopt -o nospace @@ -78,7 +78,7 @@ _comp_cmd_feh() return ;; --alpha | -${noargopts}a) - COMPREPLY=($(compgen -W '{0..255}' -- "$cur")) + _comp_compgen -- -W '{0..255}' return ;; --bg | -${noargopts}b) diff --git a/completions/find b/completions/find index 093382878bf..a3b3282e663 100644 --- a/completions/find +++ b/completions/find @@ -17,7 +17,7 @@ _comp_cmd_find() case $prev in -maxdepth | -mindepth) - COMPREPLY=($(compgen -W '{0..9}' -- "$cur")) + _comp_compgen -- -W '{0..9}' return ;; -newer | -anewer | -cnewer | -fls | -fprint | -fprint0 | -fprintf | -name | -[il]name | \ @@ -40,7 +40,7 @@ _comp_cmd_find() return ;; -xtype | -type) - COMPREPLY=($(compgen -W 'b c d p f l s' -- "$cur")) + _comp_compgen -- -W 'b c d p f l s' return ;; -uid) @@ -48,7 +48,7 @@ _comp_cmd_find() return ;; -user) - COMPREPLY=($(compgen -u -- "$cur")) + _comp_compgen -- -u return ;; -[acm]min | -[acm]time | -inum | -path | -ipath | -regex | -iregex | -links | -perm | \ diff --git a/completions/fio b/completions/fio index f9a7f843bd2..6af318020f2 100644 --- a/completions/fio +++ b/completions/fio @@ -24,11 +24,11 @@ _comp_cmd_fio() return ;; --output-format) - COMPREPLY=($(compgen -W "terse json json+ normal" -- "$cur")) + _comp_compgen -- -W "terse json json+ normal" return ;; --terse-version) - COMPREPLY=($(compgen -W "2 3 4 5" -- "$cur")) + _comp_compgen -- -W "2 3 4 5" return ;; --crctest) @@ -37,16 +37,16 @@ _comp_cmd_fio() ;; --cmdhelp) ret=($("$1" --cmdhelp=all 2>/dev/null | awk '{print $1}') all) - COMPREPLY=($(compgen -W '"${ret[@]}"' -- "$cur")) + _comp_compgen -- -W '"${ret[@]}"' return ;; --enghelp) _comp_cmd_fio__engines "$1" && - COMPREPLY=($(compgen -W '"${ret[@]}"' -- "$cur")) + _comp_compgen -- -W '"${ret[@]}"' return ;; --eta) - COMPREPLY=($(compgen -W "always never auto" -- "$cur")) + _comp_compgen -- -W "always never auto" return ;; --daemonize) @@ -62,7 +62,7 @@ _comp_cmd_fio() return ;; --idle-prof) - COMPREPLY=($(compgen -W "system percpu calibrate" -- "$cur")) + _comp_compgen -- -W "system percpu calibrate" return ;; --inflate-log) @@ -75,7 +75,7 @@ _comp_cmd_fio() ;; --trigger | --trigger-remote) compopt -o filenames - COMPREPLY=($(compgen -c -- "$cur")) + _comp_compgen -- -c return ;; --aux-path) @@ -84,11 +84,11 @@ _comp_cmd_fio() ;; --ioengine) _comp_cmd_fio__engines "$1" && - COMPREPLY=($(compgen -W '"${ret[@]}"' -- "$cur")) + _comp_compgen -- -W '"${ret[@]}"' return ;; --exec_postrun | --exec_prerun) - COMPREPLY=($(compgen -c -- "$cur")) + _comp_compgen -- -c return ;; --uid) @@ -108,7 +108,7 @@ _comp_cmd_fio() # ignore ;; *" type: boolean "* | *" type: empty or boolean "*) - COMPREPLY=($(compgen -W '0 1' -- "$cur")) + _comp_compgen -- -W '0 1' return ;; *" valid values:"*) @@ -129,7 +129,7 @@ _comp_cmd_fio() ret+=("${BASH_REMATCH[1]}") fi done - COMPREPLY=($(compgen -W '"${ret[@]}"' -- "$cur")) + _comp_compgen -- -W '"${ret[@]}"' return ;; esac diff --git a/completions/firefox b/completions/firefox index 349d47c6a52..2dc062c76f7 100644 --- a/completions/firefox +++ b/completions/firefox @@ -33,7 +33,7 @@ _comp_cmd_firefox() return ;; --debugger | -d) - COMPREPLY=($(compgen -c -- "$cur")) + _comp_compgen -- -c return ;; esac diff --git a/completions/flake8 b/completions/flake8 index dc19d4c54dd..714a2e3d288 100644 --- a/completions/flake8 +++ b/completions/flake8 @@ -12,7 +12,7 @@ _comp_cmd_flake8() return ;; --format) - COMPREPLY=($(compgen -W 'default pylint' -- "$cur")) + _comp_compgen -- -W 'default pylint' return ;; --jobs | -${noargopts}j) diff --git a/completions/freeciv b/completions/freeciv index 77fcbe47b30..2e42b9752dc 100644 --- a/completions/freeciv +++ b/completions/freeciv @@ -14,11 +14,11 @@ _comp_cmd_freeciv() return ;; --Announce | -A) - COMPREPLY=($(compgen -W 'IPv4 IPv6 none' -- "$cur")) + _comp_compgen -- -W 'IPv4 IPv6 none' return ;; --debug | -d) - COMPREPLY=($(compgen -W '{0..3}' -- "$cur")) + _comp_compgen -- -W '{0..3}' return ;; --Meta | --server | -[Ms]) @@ -26,7 +26,7 @@ _comp_cmd_freeciv() return ;; --Plugin | -P) - COMPREPLY=($(compgen -W 'none esd sdl' -- "$cur")) + _comp_compgen -- -W 'none esd sdl' return ;; esac diff --git a/completions/function b/completions/function index 4e1e470b79f..218f0cfe74c 100644 --- a/completions/function +++ b/completions/function @@ -6,7 +6,7 @@ _comp_cmd_function() _comp_initialize -- "$@" || return if ((cword == 1)); then - COMPREPLY=($(compgen -A function -- "$cur")) + _comp_compgen -- -A function else local funcdef=$(type -- "${words[1]}" 2>/dev/null | command sed -e 1,2d) COMPREPLY=("()${funcdef:+ $funcdef}") diff --git a/completions/genaliases b/completions/genaliases index 226e098be25..0fec30d2b65 100644 --- a/completions/genaliases +++ b/completions/genaliases @@ -6,7 +6,7 @@ _comp_cmd_genaliases() _comp_initialize -- "$@" || return if [[ $cur == -* ]]; then - COMPREPLY=($(compgen -W '--quiet --help' -- "$cur")) + _comp_compgen -- -W '--quiet --help' fi } && diff --git a/completions/getconf b/completions/getconf index 5732d48f6e5..4c410ac32ce 100644 --- a/completions/getconf +++ b/completions/getconf @@ -21,7 +21,7 @@ _comp_cmd_getconf() if [[ $prev == PATH_MAX ]]; then # TODO more path vars, better handling _comp_compgen_filedir elif [[ $cur == -* ]]; then - COMPREPLY=($(compgen -W '-a -v' -- "$cur")) + _comp_compgen -- -W '-a -v' else COMPREPLY=($(compgen -W \ '$("$1" -a 2>/dev/null | awk "{ print \$1 }")' -- "$cur")) diff --git a/completions/getent b/completions/getent index 35cb0a181fa..23e561fee19 100644 --- a/completions/getent +++ b/completions/getent @@ -29,19 +29,19 @@ _comp_cmd_getent() case ${db-} in passwd) - COMPREPLY=($(compgen -u -- "$cur")) + _comp_compgen -- -u return ;; group) - COMPREPLY=($(compgen -g -- "$cur")) + _comp_compgen -- -g return ;; services) - COMPREPLY=($(compgen -s -- "$cur")) + _comp_compgen -- -s return ;; hosts) - COMPREPLY=($(compgen -A hostname -- "$cur")) + _comp_compgen -- -A hostname return ;; protocols | networks | ahosts | ahostsv4 | ahostsv6 | rpc) diff --git a/completions/gnokii b/completions/gnokii index 4a17599669d..a21b77af19a 100644 --- a/completions/gnokii +++ b/completions/gnokii @@ -3,7 +3,7 @@ _comp_cmd_gnokii__memory_type() { # TODO: reduce the number of choices - COMPREPLY=($(compgen -W "IN OU SM ME MT" -- "$cur")) + _comp_compgen -- -W "IN OU SM ME MT" } _comp_cmd_gnokii() @@ -41,7 +41,7 @@ _comp_cmd_gnokii() # MONITOR --monitor) - COMPREPLY=($(compgen -W 'delay once' -- "$cur")) + _comp_compgen -- -W 'delay once' return ;; --getdisplaystatus | --displayoutput) @@ -97,7 +97,7 @@ _comp_cmd_gnokii() return ;; --divert) - COMPREPLY=($(compgen -W '--op' -- "$cur")) + _comp_compgen -- -W '--op' return ;; @@ -112,7 +112,7 @@ _comp_cmd_gnokii() # SETTINGS --reset) - COMPREPLY=($(compgen -W 'soft hard' -- "$cur")) + _comp_compgen -- -W 'soft hard' return ;; --setdatetime | --setalarm) @@ -131,7 +131,7 @@ _comp_cmd_gnokii() # LOGOS --sendlogo) - COMPREPLY=($(compgen -W 'caller op picture' -- "$cur")) + _comp_compgen -- -W 'caller op picture' return ;; --setlogo | --getlogo) @@ -145,7 +145,7 @@ _comp_cmd_gnokii() ;; --entersecuritycode) - COMPREPLY=($(compgen -W 'PIN PIN2 PUK PUK2 SEC' -- "$cur")) + _comp_compgen -- -W 'PIN PIN2 PUK PUK2 SEC' return ;; @@ -166,11 +166,11 @@ _comp_cmd_gnokii() return ;; --gettodo | --getcalendarnote) - COMPREPLY=($(compgen -W '{1..9} end --vCal' -- "$cur")) + _comp_compgen -- -W '{1..9} end --vCal' return ;; --deletecalendarnote) - COMPREPLY=($(compgen -W '{1..9} end' -- "$cur")) + _comp_compgen -- -W '{1..9} end' return ;; --divert) @@ -186,20 +186,20 @@ _comp_cmd_gnokii() tprev=${words[cword - 3]} case $tprev in --deletesms | --deletemms) - COMPREPLY=($(compgen -W 'end' -- "$cur")) + _comp_compgen -- -W 'end' return ;; --getphonebook | --writetodo | --writecalendarnote) - COMPREPLY=($(compgen -W '{1..9} end' -- "$cur")) + _comp_compgen -- -W '{1..9} end' return ;; --gettodo | --getcalendarnote) [[ ${words[cword - 1]} == end ]] && - COMPREPLY=($(compgen -W '--vCal' -- "$cur")) + _comp_compgen -- -W '--vCal' return ;; --divert) - COMPREPLY=($(compgen -W '--type' -- "$cur")) + _comp_compgen -- -W '--type' return ;; esac @@ -210,7 +210,7 @@ _comp_cmd_gnokii() fprev=${words[cword - 4]} case $fprev in --getphonebook) - COMPREPLY=($(compgen -W '--raw --vcard --ldif' -- "$cur")) + _comp_compgen -- -W '--raw --vcard --ldif' return ;; --divert) @@ -234,7 +234,7 @@ _comp_cmd_gnokii() IFS=$' \t\n' [[ $COMP_LINE =~ $regex_main_cmd ]] && return - COMPREPLY=($(compgen -W "$all_cmd" -- "$cur")) + _comp_compgen -- -W "$all_cmd" } && complete -F _comp_cmd_gnokii gnokii diff --git a/completions/gnome-mplayer b/completions/gnome-mplayer index f285b7a81a9..269ddb87573 100644 --- a/completions/gnome-mplayer +++ b/completions/gnome-mplayer @@ -10,7 +10,7 @@ _comp_cmd_gnome_mplayer() return ;; --showcontrols | --showsubtitles | --autostart) - COMPREPLY=($(compgen -w '0 1' -- "$cur")) + _comp_compgen -- -w '0 1' return ;; --subtitle) @@ -18,7 +18,7 @@ _comp_cmd_gnome_mplayer() return ;; --tvdriver) - COMPREPLY=($(compgen -W 'v4l v4l2' -- "$cur")) + _comp_compgen -- -W 'v4l v4l2' return ;; esac diff --git a/completions/gnome-screenshot b/completions/gnome-screenshot index f3c93492d3a..4761aeb9600 100644 --- a/completions/gnome-screenshot +++ b/completions/gnome-screenshot @@ -12,7 +12,7 @@ _comp_cmd_gnome_screenshot() return ;; --border-effect | -${noargopts}e) - COMPREPLY=($(compgen -W 'shadow border vintage none' -- "$cur")) + _comp_compgen -- -W 'shadow border vintage none' return ;; --file | -${noargopts}f) diff --git a/completions/gpasswd b/completions/gpasswd index de4d6bf746b..b909a998f35 100644 --- a/completions/gpasswd +++ b/completions/gpasswd @@ -9,7 +9,7 @@ _comp_cmd_gpasswd() # shellcheck disable=SC2254 case $prev in --add | --delete | --administrators | --members | -${noargopts}[adAM]) - COMPREPLY=($(compgen -u -- "$cur")) + _comp_compgen -- -u return ;; esac @@ -20,7 +20,7 @@ _comp_cmd_gpasswd() return fi - COMPREPLY=($(compgen -g -- "$cur")) + _comp_compgen -- -g } && complete -F _comp_cmd_gpasswd gpasswd diff --git a/completions/gpgv b/completions/gpgv index 7c428ea082b..a497b30bac6 100644 --- a/completions/gpgv +++ b/completions/gpgv @@ -31,7 +31,7 @@ _comp_cmd_gpgv() if [[ ${COMP_LINE,,} == *.@(asc|sig|sign)\ * ]]; then # Detached signature, only complete one arbitrary file arg and - if ((args == 2)); then - COMPREPLY=($(compgen -W '-' -- "$cur")) + _comp_compgen -- -W '-' _comp_compgen -a filedir fi else diff --git a/completions/gprof b/completions/gprof index 721499cb2ca..11acfd3bbdb 100644 --- a/completions/gprof +++ b/completions/gprof @@ -35,7 +35,7 @@ _comp_cmd_gprof() return ;; --file-format) - COMPREPLY=($(compgen -W 'auto bsd 4.4bsd magic prof' -- "$cur")) + _comp_compgen -- -W 'auto bsd 4.4bsd magic prof' return ;; esac diff --git a/completions/groupdel b/completions/groupdel index 2fd0781c313..714adfa5629 100644 --- a/completions/groupdel +++ b/completions/groupdel @@ -20,7 +20,7 @@ _comp_cmd_groupdel() return fi - COMPREPLY=($(compgen -g -- "$cur")) + _comp_compgen -- -g } && complete -F _comp_cmd_groupdel groupdel diff --git a/completions/groupmems b/completions/groupmems index 421146072ff..81a68e244d1 100644 --- a/completions/groupmems +++ b/completions/groupmems @@ -7,11 +7,11 @@ _comp_cmd_groupmems() case $prev in -a | --add | -d | --delete) - COMPREPLY=($(compgen -u -- "$cur")) + _comp_compgen -- -u return ;; -g | --group) - COMPREPLY=($(compgen -g -- "$cur")) + _comp_compgen -- -g return ;; -R | --root) diff --git a/completions/groupmod b/completions/groupmod index 8f5ae3d7aae..c48538c8590 100644 --- a/completions/groupmod +++ b/completions/groupmod @@ -24,7 +24,7 @@ _comp_cmd_groupmod() return fi - COMPREPLY=($(compgen -g -- "$cur")) + _comp_compgen -- -g } && complete -F _comp_cmd_groupmod groupmod diff --git a/completions/hcitool b/completions/hcitool index ac570dd3e26..50e4a6682e0 100644 --- a/completions/hcitool +++ b/completions/hcitool @@ -38,7 +38,7 @@ _comp_cmd_hcitool() return ;; --role) - COMPREPLY=($(compgen -W 'm s' -- "$cur")) + _comp_compgen -- -W 'm s' return ;; --pkt-type) @@ -70,7 +70,7 @@ _comp_cmd_hcitool() ;; cc) if [[ $cur == -* ]]; then - COMPREPLY=($(compgen -W '--role --pkt-type' -- "$cur")) + _comp_compgen -- -W '--role --pkt-type' else _count_args if ((args == 2)); then @@ -83,7 +83,7 @@ _comp_cmd_hcitool() if ((args == 2)); then _comp_cmd_hcitool__bluetooth_addresses else - COMPREPLY=($(compgen -W 'master slave' -- "$cur")) + _comp_compgen -- -W 'master slave' fi ;; cpt) @@ -99,7 +99,7 @@ _comp_cmd_hcitool() if ((args == 2)); then _comp_cmd_hcitool__bluetooth_addresses else - COMPREPLY=($(compgen -W '0 1' -- "$cur")) + _comp_compgen -- -W '0 1' fi ;; esac @@ -142,14 +142,14 @@ _comp_cmd_sdptool() ;; browse | records) if [[ $cur == -* ]]; then - COMPREPLY=($(compgen -W '--tree --raw --xml' -- "$cur")) + _comp_compgen -- -W '--tree --raw --xml' else _comp_cmd_hcitool__bluetooth_addresses fi ;; add) if [[ $cur == -* ]]; then - COMPREPLY=($(compgen -W '--handle --channel' -- "$cur")) + _comp_compgen -- -W '--handle --channel' else _comp_cmd_hcitool__bluetooth_services fi @@ -307,7 +307,7 @@ _comp_cmd_hciconfig() _get_first_arg if [[ ! $arg ]]; then if [[ $cur == -* ]]; then - COMPREPLY=($(compgen -W '--help --all' -- "$cur")) + _comp_compgen -- -W '--help --all' else COMPREPLY=($(compgen -W 'up down reset rstat auth noauth encrypt noencrypt secmgr nosecmgr piscan noscan iscan pscan ptype name @@ -348,7 +348,7 @@ _comp_cmd_hciattach() _comp_initialize -- "$@" || return if [[ $cur == -* ]]; then - COMPREPLY=($(compgen -W '-n -p -t -b -s -l' -- "$cur")) + _comp_compgen -- -W '-n -p -t -b -s -l' else local args _count_args @@ -368,7 +368,7 @@ _comp_cmd_hciattach() 460800 921600' -- "$cur")) ;; 4) - COMPREPLY=($(compgen -W 'flow noflow' -- "$cur")) + _comp_compgen -- -W 'flow noflow' ;; 5) _comp_cmd_hcitool__bluetooth_addresses diff --git a/completions/hddtemp b/completions/hddtemp index 673a382f853..d4006f7c2f4 100644 --- a/completions/hddtemp +++ b/completions/hddtemp @@ -17,7 +17,7 @@ _comp_cmd_hddtemp() return ;; --unit | -${noargopts}u) - COMPREPLY=($(compgen -W 'C F' -- "$cur")) + _comp_compgen -- -W 'C F' return ;; --port | --separator | --syslog | --version | --help | -${noargopts}[psSvh?]) diff --git a/completions/help b/completions/help index e36cb2f2106..80992adceaf 100644 --- a/completions/help +++ b/completions/help @@ -11,7 +11,7 @@ _comp_cmd_help() fi local IFS=$'\t\n' - COMPREPLY=($(compgen -A helptopic -- "$cur")) + _comp_compgen -- -A helptopic ((${#COMPREPLY[*]} != 1)) || printf -v "COMPREPLY[0]" %q "$COMPREPLY" } && complete -F _comp_cmd_help help diff --git a/completions/htop b/completions/htop index a3c8e0ec6a4..b7e1a75fcfb 100644 --- a/completions/htop +++ b/completions/htop @@ -13,7 +13,7 @@ _comp_cmd_htop() return ;; --user | -${noargopts}u) - COMPREPLY=($(compgen -u -- "$cur")) + _comp_compgen -- -u return ;; --delay | -${noargopts}d) diff --git a/completions/hunspell b/completions/hunspell index e24b8d9d7fb..fe9c6a5d738 100644 --- a/completions/hunspell +++ b/completions/hunspell @@ -16,7 +16,7 @@ _comp_cmd_hunspell() dicts=("${dicts[@]##*/}") dicts=("${dicts[@]%.dic}") local IFS=$'\n' - COMPREPLY=($(compgen -W '"${dicts[@]}"' -- "$cur")) + _comp_compgen -- -W '"${dicts[@]}"' fi return ;; diff --git a/completions/id b/completions/id index 5eaaa8328dc..2a0eb8f5084 100644 --- a/completions/id +++ b/completions/id @@ -8,7 +8,7 @@ _comp_cmd_id() if [[ $cur == -* ]]; then local opts=$(_parse_help "$1") [[ $opts ]] || opts="-G -g -u" # POSIX fallback - COMPREPLY=($(compgen -W "$opts" -- "$cur")) + _comp_compgen -- -W "$opts" else COMPREPLY=($(compgen -u "$cur")) fi diff --git a/completions/ifup b/completions/ifup index 356c3f85632..c57e56bec25 100644 --- a/completions/ifup +++ b/completions/ifup @@ -34,7 +34,7 @@ _comp_cmd_ifupdown() if ((args == 1)); then _configured_interfaces ((${#COMPREPLY[@]})) && - COMPREPLY=($(compgen -W '"${COMPREPLY[@]}"' -- "$cur")) + _comp_compgen -- -W '"${COMPREPLY[@]}"' fi } && complete -F _comp_cmd_ifupdown ifup ifdown ifquery ifstatus diff --git a/completions/inject b/completions/inject index a8d9f02328b..70e3acd023e 100644 --- a/completions/inject +++ b/completions/inject @@ -15,7 +15,7 @@ _comp_cmd_inject() [[ $was_split ]] && return if [[ $cur == -* ]]; then - COMPREPLY=($(compgen -W '--listname --queue --help' -- "$cur")) + _comp_compgen -- -W '--listname --queue --help' else _comp_compgen_filedir fi diff --git a/completions/inotifywait b/completions/inotifywait index 6347170155c..2d73c680a3d 100644 --- a/completions/inotifywait +++ b/completions/inotifywait @@ -31,7 +31,7 @@ _comp_cmd_inotifywait() return ;; --ascending | --descending) - COMPREPLY=($(compgen -W 'total' -- "$cur")) + _comp_compgen -- -W 'total' _comp_cmd_inotifywait__events "$1" return ;; diff --git a/completions/installpkg b/completions/installpkg index 10eb4f10aa1..d05f9491bc2 100644 --- a/completions/installpkg +++ b/completions/installpkg @@ -11,7 +11,7 @@ _comp_cmd_installpkg() return ;; --priority) - COMPREPLY=($(compgen -W 'ADD REC OPT SKP' -- "$cur")) + _comp_compgen -- -W 'ADD REC OPT SKP' return ;; --tagfile) diff --git a/completions/invoke-rc.d b/completions/invoke-rc.d index 3c66df0873d..6119c5380cb 100644 --- a/completions/invoke-rc.d +++ b/completions/invoke-rc.d @@ -26,7 +26,7 @@ _comp_cmd_invoke_rc_d() ((${#valid_options[@]})) && COMPREPLY+=("${valid_options[@]}") ((${#services[@]})) && COMPREPLY+=("${services[@]}") ((${#COMPREPLY[@]})) && - COMPREPLY=($(compgen -W '"${COMPREPLY[@]}"' -- "$cur")) + _comp_compgen -- -W '"${COMPREPLY[@]}"' elif [[ -x $sysvdir/$prev ]]; then COMPREPLY=($(compgen -W '`command sed -e "y/|/ /" \ -ne "s/^.*Usage:[ ]*[^ ]*[ ]*{*\([^}\"]*\).*$/\1/p" \ diff --git a/completions/ip b/completions/ip index 337542df39b..5a11a8b373b 100644 --- a/completions/ip +++ b/completions/ip @@ -26,7 +26,7 @@ _comp_cmd_ip() return ;; -f | -family) - COMPREPLY=($(compgen -W 'inet inet6 ipx dnet link' -- "$cur")) + _comp_compgen -- -W 'inet inet6 ipx dnet link' return ;; -b | -batch) @@ -38,7 +38,7 @@ _comp_cmd_ip() return ;; -force) - COMPREPLY=($(compgen -W '-batch' -- "$cur")) + _comp_compgen -- -W '-batch' return ;; esac @@ -95,7 +95,7 @@ _comp_cmd_ip() _available_interfaces ;; 2) - COMPREPLY=($(compgen -W 'type' -- "$cur")) + _comp_compgen -- -W 'type' ;; 3) [[ $prev == type ]] && @@ -111,7 +111,7 @@ _comp_cmd_ip() case $prev in arp | dynamic | multicast | allmulticast | promisc | \ trailers) - COMPREPLY=($(compgen -W 'on off' -- "$cur")) + _comp_compgen -- -W 'on off' ;; txqueuelen | name | address | broadcast | mtu | netns | alias) ;; @@ -120,7 +120,7 @@ _comp_cmd_ip() promisc trailers txqueuelen name address broadcast mtu netns alias" [[ $prev != @(up|down) ]] && c+=" up down" - COMPREPLY=($(compgen -W "$c" -- "$cur")) + _comp_compgen -- -W "$c" ;; esac fi @@ -227,9 +227,9 @@ _comp_cmd_ip() elif [[ $prev == dev ]]; then _available_interfaces -a elif [[ $prev == table ]]; then - COMPREPLY=($(compgen -W 'local main default' -- "$cur")) + _comp_compgen -- -W 'local main default' else - COMPREPLY=($(compgen -W 'via dev weight' -- "$cur")) + _comp_compgen -- -W 'via dev weight' fi ;; *) @@ -252,7 +252,7 @@ _comp_cmd_ip() _available_interfaces -a ;; table | lookup) - COMPREPLY=($(compgen -W 'local main default' -- "$cur")) + _comp_compgen -- -W 'local main default' ;; *) COMPREPLY=($(compgen -W 'from to tos dsfield fwmark @@ -266,7 +266,7 @@ _comp_cmd_ip() if [[ $prev == protocol ]]; then : else - COMPREPLY=($(compgen -W 'protocol' -- "$cur")) + _comp_compgen -- -W 'protocol' fi ;; restore | show) ;; @@ -335,7 +335,7 @@ _comp_cmd_ip() _available_interfaces if [[ $prev != dev ]]; then COMPREPLY+=(dev) - COMPREPLY=($(compgen -W '"${COMPREPLY[@]}"' -- "$cur")) + _comp_compgen -- -W '"${COMPREPLY[@]}"' fi fi ;; @@ -354,7 +354,7 @@ _comp_cmd_ip() ;; *) ((cword == subcword)) && - COMPREPLY=($(compgen -W 'help show' -- "$cur")) + _comp_compgen -- -W 'help show' ;; esac ;; @@ -364,7 +364,7 @@ _comp_cmd_ip() all) ;; *) ((cword == subcword)) && - COMPREPLY=($(compgen -W 'help all' -- "$cur")) + _comp_compgen -- -W 'help all' ;; esac ;; diff --git a/completions/iperf b/completions/iperf index 7342315332a..89e0adea766 100644 --- a/completions/iperf +++ b/completions/iperf @@ -23,7 +23,7 @@ _comp_cmd_iperf() command sed -ne 's/^.*--format .*\[\([a-zA-Z]\{1,\}\)\].*/\1/p' | command sed -e 's/./& /g' ) - COMPREPLY=($(compgen -W '$formats' -- "$cur")) + _comp_compgen -- -W '$formats' return ;; --pidfile | -${noargopts}I) @@ -49,11 +49,11 @@ _comp_cmd_iperf() return ;; --reportexclude | -${noargopts}x) - COMPREPLY=($(compgen -W 'C D M S V' -- "$cur")) + _comp_compgen -- -W 'C D M S V' return ;; --reportstyle | -${noargopts}y) - COMPREPLY=($(compgen -W 'C' -- "$cur")) + _comp_compgen -- -W 'C' return ;; --logfile) diff --git a/completions/ipmitool b/completions/ipmitool index 29a13b75bda..6acc5d65c67 100644 --- a/completions/ipmitool +++ b/completions/ipmitool @@ -38,7 +38,7 @@ _comp_cmd_ipmitool() return ;; -*C) - COMPREPLY=($(compgen -W '{0..14}' -- "$cur")) + _comp_compgen -- -W '{0..14}' return ;; -*L) @@ -47,7 +47,7 @@ _comp_cmd_ipmitool() return ;; -*A) - COMPREPLY=($(compgen -W 'NONE PASSWORD MD2 MD5 OEM' -- "$cur")) + _comp_compgen -- -W 'NONE PASSWORD MD2 MD5 OEM' return ;; -*o) @@ -76,7 +76,7 @@ _comp_cmd_ipmitool() done if [[ ! $has_cmd ]]; then - COMPREPLY=($(compgen -W '"${cmds[@]}"' -- "$cur")) + _comp_compgen -- -W '"${cmds[@]}"' return fi @@ -100,11 +100,11 @@ _comp_cmd_ipmitool() alert) [[ $prev == alert ]] && - COMPREPLY=($(compgen -W 'print set' -- "$cur")) + _comp_compgen -- -W 'print set' ;; stats) [[ $prev == stats ]] && - COMPREPLY=($(compgen -W 'print set' -- "$cur")) + _comp_compgen -- -W 'print set' ;; *) COMPREPLY=($(compgen -W 'print set alert stats' \ @@ -127,7 +127,7 @@ _comp_cmd_ipmitool() fill) case $prev in fill) - COMPREPLY=($(compgen -W 'sensors file' -- "$cur")) + _comp_compgen -- -W 'sensors file' ;; file) _comp_compgen_filedir @@ -146,7 +146,7 @@ _comp_cmd_ipmitool() list | get | thresh) ;; *) - COMPREPLY=($(compgen -W 'list get thresh' -- "$cur")) + _comp_compgen -- -W 'list get thresh' ;; esac ;; @@ -160,7 +160,7 @@ _comp_cmd_ipmitool() ;; time) [[ $prev == time ]] && - COMPREPLY=($(compgen -W 'get set' -- "$cur")) + _comp_compgen -- -W 'get set' ;; *) COMPREPLY=($(compgen -W 'info clear list elist delete add @@ -175,7 +175,7 @@ _comp_cmd_ipmitool() set) [[ $prev == set ]] && - COMPREPLY=($(compgen -W 'name password' -- "$cur")) + _comp_compgen -- -W 'name password' ;; *) COMPREPLY=($(compgen -W 'summary list set disable enable diff --git a/completions/ipsec b/completions/ipsec index 7a54a5a4949..02aae76d61c 100644 --- a/completions/ipsec +++ b/completions/ipsec @@ -11,7 +11,7 @@ _comp_cmd_ipsec__connections() [[ $keyword == conn && $name != '%default' ]] && COMPREPLY+=("$name") done ((${#COMPREPLY[@]})) && - COMPREPLY=($(compgen -W '"${COMPREPLY[@]}"' -- "$cur")) + _comp_compgen -- -W '"${COMPREPLY[@]}"' } _comp_cmd_ipsec__freeswan() @@ -37,10 +37,10 @@ _comp_cmd_ipsec__freeswan() -- "$cur")) ;; ranbits) - COMPREPLY=($(compgen -W '--quick --continuous --bytes' -- "$cur")) + _comp_compgen -- -W '--quick --continuous --bytes' ;; setup) - COMPREPLY=($(compgen -W '--start --stop --restart' -- "$cur")) + _comp_compgen -- -W '--start --stop --restart' ;; *) ;; @@ -71,7 +71,7 @@ _comp_cmd_ipsec__strongswan() _comp_cmd_ipsec__connections <"$confdir/ipsec.conf" ;; list*) - COMPREPLY=($(compgen -W '--utc' -- "$cur")) + _comp_compgen -- -W '--utc' ;; restart | start) COMPREPLY=($(compgen -W '--attach-gdb --auto-update --debug diff --git a/completions/iptables b/completions/iptables index 978a363f2a7..63f6c0fd358 100644 --- a/completions/iptables +++ b/completions/iptables @@ -17,7 +17,7 @@ _comp_cmd_iptables() command sed -ne "s/^Chain \([^ ]\{1,\}\).*$/\1/p"`' -- "$cur")) ;; -*t) - COMPREPLY=($(compgen -W 'nat filter mangle' -- "$cur")) + _comp_compgen -- -W 'nat filter mangle' ;; -j) if [[ $table == "filter" || ! $table ]]; then diff --git a/completions/iscsiadm b/completions/iscsiadm index a82d54c4921..f358bdfb5e0 100644 --- a/completions/iscsiadm +++ b/completions/iscsiadm @@ -14,15 +14,15 @@ _comp_cmd_iscsiadm() return ;; --op | -${noargopts}o) - COMPREPLY=($(compgen -W 'new delete update show' -- "$cur")) + _comp_compgen -- -W 'new delete update show' return ;; --type | -${noargopts}t) - COMPREPLY=($(compgen -W 'sendtargets st slp isns fw' -- "$cur")) + _comp_compgen -- -W 'sendtargets st slp isns fw' return ;; --loginall | --logoutall | -${noargopts}[LU]) - COMPREPLY=($(compgen -W 'all manual automatic' -- "$cur")) + _comp_compgen -- -W 'all manual automatic' return ;; esac @@ -61,7 +61,7 @@ _comp_cmd_iscsiadm() options='--mode' fi - COMPREPLY=($(compgen -W "$options" -- "$cur")) + _comp_compgen -- -W "$options" } && complete -F _comp_cmd_iscsiadm iscsiadm diff --git a/completions/isort b/completions/isort index 7f353470398..cb25901ede7 100644 --- a/completions/isort +++ b/completions/isort @@ -19,7 +19,7 @@ _comp_cmd_isort() return ;; --multi-line | -m) - COMPREPLY=($(compgen -W '{0..5}' -- "$cur")) + _comp_compgen -- -W '{0..5}' return ;; --section-default | -sd) diff --git a/completions/iwconfig b/completions/iwconfig index 5e9fe3be1ca..727fa57120a 100644 --- a/completions/iwconfig +++ b/completions/iwconfig @@ -12,7 +12,7 @@ _comp_cmd_iwconfig() return ;; essid) - COMPREPLY=($(compgen -W 'on off any' -- "$cur")) + _comp_compgen -- -W 'on off any' if [[ ${BASH_COMPLETION_CMD_IWCONFIG_SCAN-${COMP_IWLIST_SCAN-}} ]]; then COMPREPLY+=($(compgen -W \ "$(iwlist "${words[1]}" scan | @@ -21,7 +21,7 @@ _comp_cmd_iwconfig() return ;; nwid) - COMPREPLY=($(compgen -W 'on off' -- "$cur")) + _comp_compgen -- -W 'on off' return ;; channel) @@ -36,7 +36,7 @@ _comp_cmd_iwconfig() return ;; ap) - COMPREPLY=($(compgen -W 'on off any' -- "$cur")) + _comp_compgen -- -W 'on off any' if [[ ${BASH_COMPLETION_CMD_IWCONFIG_SCAN-${COMP_IWLIST_SCAN-}} ]]; then COMPREPLY+=($(compgen -W \ "$(iwlist "${words[1]}" scan | @@ -45,37 +45,37 @@ _comp_cmd_iwconfig() return ;; rate) - COMPREPLY=($(compgen -W 'auto fixed' -- "$cur")) + _comp_compgen -- -W 'auto fixed' COMPREPLY+=($(compgen -W \ "$(iwlist "${words[1]}" rate | awk '/^[ \t]*[0-9]/ {print $1"M"}')" -- "$cur")) return ;; rts | frag) - COMPREPLY=($(compgen -W 'auto fixed off' -- "$cur")) + _comp_compgen -- -W 'auto fixed off' return ;; key | enc) - COMPREPLY=($(compgen -W 'off on open restricted' -- "$cur")) + _comp_compgen -- -W 'off on open restricted' return ;; power) - COMPREPLY=($(compgen -W 'period timeout off on' -- "$cur")) + _comp_compgen -- -W 'period timeout off on' return ;; txpower) - COMPREPLY=($(compgen -W 'off on auto' -- "$cur")) + _comp_compgen -- -W 'off on auto' return ;; retry) - COMPREPLY=($(compgen -W 'limit lifetime' -- "$cur")) + _comp_compgen -- -W 'limit lifetime' return ;; esac if ((cword == 1)); then if [[ $cur == -* ]]; then - COMPREPLY=($(compgen -W '--help --version' -- "$cur")) + _comp_compgen -- -W '--help --version' else _available_interfaces -w fi diff --git a/completions/iwlist b/completions/iwlist index e834af75a0e..cee69a1b7cb 100644 --- a/completions/iwlist +++ b/completions/iwlist @@ -7,7 +7,7 @@ _comp_cmd_iwlist() if ((cword == 1)); then if [[ $cur == -* ]]; then - COMPREPLY=($(compgen -W '--help --version' -- "$cur")) + _comp_compgen -- -W '--help --version' else _available_interfaces -w fi diff --git a/completions/iwpriv b/completions/iwpriv index f7cabe61745..343cf014e7c 100644 --- a/completions/iwpriv +++ b/completions/iwpriv @@ -7,23 +7,23 @@ _comp_cmd_iwpriv() case $prev in roam) - COMPREPLY=($(compgen -W 'on off' -- "$cur")) + _comp_compgen -- -W 'on off' return ;; port) - COMPREPLY=($(compgen -W 'ad-hoc managed' -- "$cur")) + _comp_compgen -- -W 'ad-hoc managed' return ;; esac if ((cword == 1)); then if [[ $cur == -* ]]; then - COMPREPLY=($(compgen -W '--help --version' -- "$cur")) + _comp_compgen -- -W '--help --version' else _available_interfaces -w fi else - COMPREPLY=($(compgen -W '--all roam port' -- "$cur")) + _comp_compgen -- -W '--all roam port' fi } && complete -F _comp_cmd_iwpriv iwpriv diff --git a/completions/iwspy b/completions/iwspy index f624e43c283..b13aa8e66f3 100644 --- a/completions/iwspy +++ b/completions/iwspy @@ -7,12 +7,12 @@ _comp_cmd_iwspy() if ((cword == 1)); then if [[ $cur == -* ]]; then - COMPREPLY=($(compgen -W '--help --version' -- "$cur")) + _comp_compgen -- -W '--help --version' else _available_interfaces -w fi else - COMPREPLY=($(compgen -W 'setthr getthr off' -- "$cur")) + _comp_compgen -- -W 'setthr getthr off' fi } && complete -F _comp_cmd_iwspy iwspy diff --git a/completions/jar b/completions/jar index 5a150019a5e..464bed64c74 100644 --- a/completions/jar +++ b/completions/jar @@ -6,7 +6,7 @@ _comp_cmd_jar() _comp_initialize -- "$@" || return if ((cword == 1)); then - COMPREPLY=($(compgen -W 'c t x u' -- "$cur")) + _comp_compgen -- -W 'c t x u' return fi diff --git a/completions/jarsigner b/completions/jarsigner index 8aae6dd4c0f..927dc0ab37f 100644 --- a/completions/jarsigner +++ b/completions/jarsigner @@ -7,7 +7,7 @@ _comp_cmd_jarsigner() case $prev in -keystore) - COMPREPLY=($(compgen -W 'NONE' -- "$cur")) + _comp_compgen -- -W 'NONE' _comp_compgen -a filedir '@(jks|ks|p12|pfx)' return ;; @@ -21,7 +21,7 @@ _comp_cmd_jarsigner() return ;; -storetype) - COMPREPLY=($(compgen -W 'JKS PKCS11 PKCS12' -- "$cur")) + _comp_compgen -- -W 'JKS PKCS11 PKCS12' return ;; -signedjar) diff --git a/completions/jpegoptim b/completions/jpegoptim index 0e102ad7d29..101bad6d22f 100644 --- a/completions/jpegoptim +++ b/completions/jpegoptim @@ -16,11 +16,11 @@ _comp_cmd_jpegoptim() return ;; --max | --threshold | -${noargopts}[mT]) - COMPREPLY=($(compgen -W '{0..100}' -- "$cur")) + _comp_compgen -- -W '{0..100}' return ;; --size | -${noargopts}S) - COMPREPLY=($(compgen -W '{1..99}%' -- "$cur")) + _comp_compgen -- -W '{1..99}%' return ;; esac diff --git a/completions/jps b/completions/jps index bf288f2d99f..f90ab7eaafc 100644 --- a/completions/jps +++ b/completions/jps @@ -14,7 +14,7 @@ _comp_cmd_jps() if [[ $cur == -* ]]; then # Not using _parse_usage because output has [-help] which does not # mean -h, -e, -l, -p... - COMPREPLY=($(compgen -W "-q -m -l -v -V -J -help" -- "$cur")) + _comp_compgen -- -W "-q -m -l -v -V -J -help" [[ ${COMPREPLY-} == -J* ]] && compopt -o nospace else _known_hosts_real -- "$cur" diff --git a/completions/jq b/completions/jq index bf9ba988d74..30039d6b342 100644 --- a/completions/jq +++ b/completions/jq @@ -12,7 +12,7 @@ _comp_cmd_jq() return ;; --indent) - COMPREPLY=($(compgen -W '{1..8}' -- "$cur")) + _comp_compgen -- -W '{1..8}' return ;; --from-file | --run-tests | -${noargopts}f) diff --git a/completions/jshint b/completions/jshint index 35cdac982f9..ee083140610 100644 --- a/completions/jshint +++ b/completions/jshint @@ -14,11 +14,11 @@ _comp_cmd_jshint() return ;; --reporter) - COMPREPLY=($(compgen -W "jslint checkstyle unix" -- "$cur")) + _comp_compgen -- -W "jslint checkstyle unix" return ;; --extract) - COMPREPLY=($(compgen -W "auto always never" -- "$cur")) + _comp_compgen -- -W "auto always never" return ;; esac diff --git a/completions/k3b b/completions/k3b index da781b3aa15..746e3328ab8 100644 --- a/completions/k3b +++ b/completions/k3b @@ -31,7 +31,7 @@ _comp_cmd_k3b() return ;; --ao) - COMPREPLY=($(compgen -W 'alsa arts' -- "$cur")) + _comp_compgen -- -W 'alsa arts' return ;; esac diff --git a/completions/kcov b/completions/kcov index 110edb57126..5dd9c0a2ffe 100644 --- a/completions/kcov +++ b/completions/kcov @@ -32,11 +32,11 @@ _comp_cmd_kcov() if [[ $cur == ?*,* ]]; then prev="${cur%,*}" cur="${cur##*,}" - COMPREPLY=($(compgen -W "{0..100}" -- "$cur")) + _comp_compgen -- -W "{0..100}" ((${#COMPREPLY[@]} == 1)) && COMPREPLY=(${COMPREPLY/#/$prev,}) else - COMPREPLY=($(compgen -W "{0..100}" -- "$cur")) + _comp_compgen -- -W "{0..100}" ((${#COMPREPLY[@]} == 1)) && COMPREPLY=(${COMPREPLY/%/,}) compopt -o nospace fi diff --git a/completions/koji b/completions/koji index dc654729498..69f4afd17b8 100644 --- a/completions/koji +++ b/completions/koji @@ -61,7 +61,7 @@ _comp_cmd_koji() return ;; --authtype) - COMPREPLY=($(compgen -W 'noauth ssl password kerberos' -- "$cur")) + _comp_compgen -- -W 'noauth ssl password kerberos' return ;; --topdir) @@ -71,7 +71,7 @@ _comp_cmd_koji() --type) case ${command-} in latest-pkg | list-tagged) - COMPREPLY=($(compgen -W 'maven' -- "$cur")) + _comp_compgen -- -W 'maven' ;; esac return diff --git a/completions/ktutil b/completions/ktutil index db303153f25..90e3b9e7800 100644 --- a/completions/ktutil +++ b/completions/ktutil @@ -97,7 +97,7 @@ _comp_cmd_ktutil() options='-k --keytab -v --verbose --version -v --help' ;; esac - COMPREPLY=($(compgen -W "$options" -- "$cur")) + _comp_compgen -- -W "$options" else case ${command-} in copy) @@ -110,7 +110,7 @@ _comp_cmd_ktutil() _comp_cmd_ktutil__heimdal_principals ;; *) - COMPREPLY=($(compgen -W "$commands" -- "$cur")) + _comp_compgen -- -W "$commands" ;; esac fi diff --git a/completions/lastlog b/completions/lastlog index cb89b7902e4..2c5a39d64b8 100644 --- a/completions/lastlog +++ b/completions/lastlog @@ -12,7 +12,7 @@ _comp_cmd_lastlog() return ;; --user | -${noargopts}u) - COMPREPLY=($(compgen -u -- "$cur")) + _comp_compgen -- -u return ;; esac diff --git a/completions/ldapsearch b/completions/ldapsearch index ebf7e840e56..afc418f3dc9 100644 --- a/completions/ldapsearch +++ b/completions/ldapsearch @@ -2,12 +2,12 @@ _comp_cmd_ldapsearch__ldap_uris() { - COMPREPLY=($(compgen -W 'ldap:// ldaps://' -- "$cur")) + _comp_compgen -- -W 'ldap:// ldaps://' } _comp_cmd_ldapsearch__ldap_protocols() { - COMPREPLY=($(compgen -W '2 3' -- "$cur")) + _comp_compgen -- -W '2 3' } _comp_cmd_ldapsearch() @@ -33,11 +33,11 @@ _comp_cmd_ldapsearch() return ;; -*s) - COMPREPLY=($(compgen -W 'base one sub children' -- "$cur")) + _comp_compgen -- -W 'base one sub children' return ;; -*a) - COMPREPLY=($(compgen -W 'never always search find' -- "$cur")) + _comp_compgen -- -W 'never always search find' return ;; -*P) diff --git a/completions/ldapvi b/completions/ldapvi index 535174cf43c..0d132b416d2 100644 --- a/completions/ldapvi +++ b/completions/ldapvi @@ -18,15 +18,15 @@ _comp_cmd_ldapvi() return ;; --bind) - COMPREPLY=($(compgen -W 'simple sasl' -- "$cur")) + _comp_compgen -- -W 'simple sasl' return ;; --bind-dialog) - COMPREPLY=($(compgen -W 'never auto always' -- "$cur")) + _comp_compgen -- -W 'never auto always' return ;; --scope) - COMPREPLY=($(compgen -W 'base one sub' -- "$cur")) + _comp_compgen -- -W 'base one sub' return ;; --deref) @@ -35,11 +35,11 @@ _comp_cmd_ldapvi() return ;; --encoding) - COMPREPLY=($(compgen -W 'ASCII UTF-8 binary' -- "$cur")) + _comp_compgen -- -W 'ASCII UTF-8 binary' return ;; --tls) - COMPREPLY=($(compgen -W 'never allow try strict' -- "$cur")) + _comp_compgen -- -W 'never allow try strict' return ;; esac diff --git a/completions/lftpget b/completions/lftpget index 34522272b18..a41ad0c5a8a 100644 --- a/completions/lftpget +++ b/completions/lftpget @@ -6,7 +6,7 @@ _comp_cmd_lftpget() _comp_initialize -- "$@" || return if [[ $cur == -* ]]; then - COMPREPLY=($(compgen -W '-c -d -v' -- "$cur")) + _comp_compgen -- -W '-c -d -v' fi } && complete -F _comp_cmd_lftpget lftpget diff --git a/completions/links b/completions/links index 9a6e92bcb11..ea14d6ddc89 100644 --- a/completions/links +++ b/completions/links @@ -7,11 +7,11 @@ _comp_cmd_links() case $prev in -html-t-text-color | -html-t-link-color) - COMPREPLY=($(compgen -W '{0..15}' -- "$cur")) + _comp_compgen -- -W '{0..15}' return ;; -http.fake-firefox | -html-[gt]-ignore-document-color) - COMPREPLY=($(compgen -W '0 1' -- "$cur")) + _comp_compgen -- -W '0 1' return ;; --help | -help | -mode | -display | -source | -dump | -width | -max-connections | \ @@ -30,7 +30,7 @@ _comp_cmd_links() local drivers=$("$1" -driver foo 2>&1 | command sed -ne '$!d' -e '/^[a-z0-9, ]\{1,\}$/s/,/ /gp') [[ $drivers ]] || drivers='x svgalib fb directfb pmshell atheos' - COMPREPLY=($(compgen -W "$drivers" -- "$cur")) + _comp_compgen -- -W "$drivers" return ;; -codepage | -bookmarks-codepage | -http-assume-codepage) @@ -54,15 +54,15 @@ _comp_cmd_links() -http-bugs.* | -http.do-not-track | -ftp.use-* | -ftp.fast | -ftp.set-iptos | \ -smb.allow-hyperlinks-to-smb | -save-url-history | -dither-letters | \ -dither-images | -overwrite-instead-of-scroll | -html-*) - COMPREPLY=($(compgen -W '0 1' -- "$cur")) + _comp_compgen -- -W '0 1' return ;; -address-preference | -http.referer) - COMPREPLY=($(compgen -W '{0..4}' -- "$cur")) + _comp_compgen -- -W '{0..4}' return ;; -ssl-certificates | -display-optimize | -gamma-correction) - COMPREPLY=($(compgen -W '{0..2}' -- "$cur")) + _comp_compgen -- -W '{0..2}' return ;; -ssl.client-cert-key) diff --git a/completions/lintian b/completions/lintian index bcc5de24171..876784ede14 100644 --- a/completions/lintian +++ b/completions/lintian @@ -105,7 +105,7 @@ _comp_cmd_lintian() return ;; --color) - COMPREPLY=($(compgen -W "never always auto html" -- "$cur")) + _comp_compgen -- -W "never always auto html" return ;; -U | --unpack-info) @@ -113,7 +113,7 @@ _comp_cmd_lintian() return ;; --area | --section) - COMPREPLY=($(compgen -W "main contrib non-free" -- "$cur")) + _comp_compgen -- -W "main contrib non-free" return ;; --arch) diff --git a/completions/list_admins b/completions/list_admins index 0d81d1431f8..af0d0f204f2 100644 --- a/completions/list_admins +++ b/completions/list_admins @@ -6,7 +6,7 @@ _comp_cmd_list_admins() _comp_initialize -- "$@" || return if [[ $cur == -* ]]; then - COMPREPLY=($(compgen -W '--all-vhost --all --help' -- "$cur")) + _comp_compgen -- -W '--all-vhost --all --help' else _comp_xfunc list_lists mailman_lists fi diff --git a/completions/list_members b/completions/list_members index 63214a2011f..cf9ca5844ac 100644 --- a/completions/list_members +++ b/completions/list_members @@ -11,7 +11,7 @@ _comp_cmd_list_members() return ;; -d | --digest) - COMPREPLY=($(compgen -W 'mime plain' -- "$cur")) + _comp_compgen -- -W 'mime plain' return ;; -n | --nomail) diff --git a/completions/lpq b/completions/lpq index 452f24d9632..89f5e1e70c3 100644 --- a/completions/lpq +++ b/completions/lpq @@ -11,13 +11,13 @@ _comp_cmd_lpq() return ;; -U) - COMPREPLY=($(compgen -u -- "$cur")) + _comp_compgen -- -u return ;; esac if [[ $cur == - ]]; then - COMPREPLY=($(compgen -W '-E -P -U -a -h -l' -- "$cur")) + _comp_compgen -- -W '-E -P -U -a -h -l' return fi diff --git a/completions/lpr b/completions/lpr index 3b633e00ebd..86ae3344be9 100644 --- a/completions/lpr +++ b/completions/lpr @@ -11,18 +11,18 @@ _comp_cmd_lpr() return ;; -U) - COMPREPLY=($(compgen -u -- "$cur")) + _comp_compgen -- -u return ;; -o) - COMPREPLY=($(compgen -W "media= landscape orientation-requested= sides= fitplot number-up= scaling= cpi= lpi= page-bottom= page-top= page-left= page-right=" -- "$cur")) + _comp_compgen -- -W "media= landscape orientation-requested= sides= fitplot number-up= scaling= cpi= lpi= page-bottom= page-top= page-left= page-right=" [[ ${COMPREPLY-} == *= ]] && compopt -o nospace return ;; esac if [[ $cur == - ]]; then - COMPREPLY=($(compgen -W '-E -H -C -J -T -P -U -h -l -m -o -p -q -r' -- "$cur")) + _comp_compgen -- -W '-E -H -C -J -T -P -U -h -l -m -o -p -q -r' return fi diff --git a/completions/lrzip b/completions/lrzip index 4c0d46a7f57..21ce7998fae 100644 --- a/completions/lrzip +++ b/completions/lrzip @@ -26,11 +26,11 @@ _comp_cmd_lrzip() return ;; --level | -${noargopts}L) - COMPREPLY=($(compgen -W '{1..9}' -- "$cur")) + _comp_compgen -- -W '{1..9}' return ;; --nice-level | -${noargopts}N) - COMPREPLY=($(compgen -W '{-20..19}' -- "$cur")) + _comp_compgen -- -W '{-20..19}' return ;; --threads | -${noargopts}p) diff --git a/completions/lsof b/completions/lsof index 8cbbdf5ef9d..4051fb391a3 100644 --- a/completions/lsof +++ b/completions/lsof @@ -18,11 +18,11 @@ _comp_cmd_lsof() return ;; -D) - COMPREPLY=($(compgen -W '? b i r u' -- "$cur")) + _comp_compgen -- -W '? b i r u' return ;; -f) - COMPREPLY=($(compgen -W 'c f g G n' -- "$cur")) + _comp_compgen -- -W 'c f g G n' return ;; -g) @@ -37,7 +37,7 @@ _comp_cmd_lsof() ;; -u) # TODO: handle ^foo exclusions, comma separated lists - COMPREPLY=($(compgen -u -- "$cur")) + _comp_compgen -- -u return ;; esac diff --git a/completions/luseradd b/completions/luseradd index ad2a6c69f09..990d4ecb7be 100644 --- a/completions/luseradd +++ b/completions/luseradd @@ -35,7 +35,7 @@ _comp_cmd_luseradd() return fi - [[ ${1##*/} == luseradd ]] || COMPREPLY=($(compgen -u -- "$cur")) + [[ ${1##*/} == luseradd ]] || _comp_compgen -- -u } && complete -F _comp_cmd_luseradd luseradd lusermod diff --git a/completions/luserdel b/completions/luserdel index 8d10c918e35..d1b42d373af 100644 --- a/completions/luserdel +++ b/completions/luserdel @@ -16,7 +16,7 @@ _comp_cmd_luserdel() return fi - COMPREPLY=($(compgen -u -- "$cur")) + _comp_compgen -- -u } && complete -F _comp_cmd_luserdel luserdel diff --git a/completions/lvm b/completions/lvm index 875d054d8a1..c8f532395f8 100644 --- a/completions/lvm +++ b/completions/lvm @@ -38,12 +38,12 @@ _comp_cmd_lvm__logicalvolumes() _comp_cmd_lvm__units() { - COMPREPLY=($(compgen -W 'h s b k m g t H K M G T' -- "$cur")) + _comp_compgen -- -W 'h s b k m g t H K M G T' } _comp_cmd_lvm__sizes() { - COMPREPLY=($(compgen -W 'k K m M g G t T' -- "$cur")) + _comp_compgen -- -W 'k K m M g G t T' } # @param $1 glob matching args known to take an argument @@ -142,7 +142,7 @@ _comp_cmd_pvchange() # shellcheck disable=SC2254 case $prev in --autobackup | --allocatable | -${noargopts}[Ax]) - COMPREPLY=($(compgen -W 'y n' -- "$cur")) + _comp_compgen -- -W 'y n' return ;; esac @@ -168,11 +168,11 @@ _comp_cmd_pvcreate() return ;; --metadatatype | -${noargopts}M) - COMPREPLY=($(compgen -W '1 2' -- "$cur")) + _comp_compgen -- -W '1 2' return ;; --metadatacopies) - COMPREPLY=($(compgen -W '0 1 2' -- "$cur")) + _comp_compgen -- -W '0 1 2' return ;; --metadatasize | --setphysicalvolumesize) @@ -198,7 +198,7 @@ _comp_cmd_pvmove() # shellcheck disable=SC2254 case $prev in --autobackup | -${noargopts}A) - COMPREPLY=($(compgen -W 'y n' -- "$cur")) + _comp_compgen -- -W 'y n' return ;; --name | -${noargopts}n) @@ -297,7 +297,7 @@ _comp_cmd_vgchange() # shellcheck disable=SC2254 case $prev in --available | --autobackup | --resizeable | -${noargopts}[aAx]) - COMPREPLY=($(compgen -W 'y n' -- "$cur")) + _comp_compgen -- -W 'y n' return ;; esac @@ -319,11 +319,11 @@ _comp_cmd_vgcreate() # shellcheck disable=SC2254 case $prev in --autobackup | -${noargopts}A) - COMPREPLY=($(compgen -W 'y n' -- "$cur")) + _comp_compgen -- -W 'y n' return ;; --metadatatype | -${noargopts}M) - COMPREPLY=($(compgen -W '1 2' -- "$cur")) + _comp_compgen -- -W '1 2' return ;; --physicalextentsize | -${noargopts}s) @@ -368,7 +368,7 @@ _comp_cmd_vgrename() # shellcheck disable=SC2254 case $prev in --autobackup | -${noargopts}A) - COMPREPLY=($(compgen -W 'y n' -- "$cur")) + _comp_compgen -- -W 'y n' return ;; esac @@ -390,7 +390,7 @@ _comp_cmd_vgreduce() # shellcheck disable=SC2254 case $prev in --autobackup | -${noargopts}A) - COMPREPLY=($(compgen -W 'y n' -- "$cur")) + _comp_compgen -- -W 'y n' return ;; esac @@ -419,7 +419,7 @@ _comp_cmd_vgextend() # shellcheck disable=SC2254 case $prev in --autobackup | -${noargopts}A) - COMPREPLY=($(compgen -W 'y n' -- "$cur")) + _comp_compgen -- -W 'y n' return ;; --size | -${noargopts}L) @@ -477,11 +477,11 @@ _comp_cmd_vgconvert() # shellcheck disable=SC2254 case $prev in --metadatatype | -${noargopts}M) - COMPREPLY=($(compgen -W '1 2' -- "$cur")) + _comp_compgen -- -W '1 2' return ;; --metadatacopies) - COMPREPLY=($(compgen -W '0 1 2' -- "$cur")) + _comp_compgen -- -W '0 1 2' return ;; --metadatasize) @@ -533,7 +533,7 @@ _comp_cmd_vgcfgrestore() return ;; --metadatatype | -${noargopts}M) - COMPREPLY=($(compgen -W '1 2' -- "$cur")) + _comp_compgen -- -W '1 2' return ;; --name | -${noargopts}n) @@ -559,7 +559,7 @@ _comp_cmd_vgmerge() # shellcheck disable=SC2254 case $prev in --autobackup | -${noargopts}A) - COMPREPLY=($(compgen -W 'y n' -- "$cur")) + _comp_compgen -- -W 'y n' return ;; esac @@ -581,11 +581,11 @@ _comp_cmd_vgsplit() # shellcheck disable=SC2254 case $prev in --autobackup | -${noargopts}A) - COMPREPLY=($(compgen -W 'y n' -- "$cur")) + _comp_compgen -- -W 'y n' return ;; --metadatatype | -${noargopts}M) - COMPREPLY=($(compgen -W '1 2' -- "$cur")) + _comp_compgen -- -W '1 2' return ;; esac @@ -685,11 +685,11 @@ _comp_cmd_lvchange() # shellcheck disable=SC2254 case $prev in --available | --autobackup | --contiguous | --persistent | -${noargopts}[aACM]) - COMPREPLY=($(compgen -W 'y n' -- "$cur")) + _comp_compgen -- -W 'y n' return ;; --permission | -${noargopts}p) - COMPREPLY=($(compgen -W 'r rw' -- "$cur")) + _comp_compgen -- -W 'r rw' return ;; esac @@ -711,7 +711,7 @@ _comp_cmd_lvcreate() # shellcheck disable=SC2254 case $prev in --autobackup | --contiguous | --persistent | --zero | -${noargopts}[ACMZ]) - COMPREPLY=($(compgen -W 'y n' -- "$cur")) + _comp_compgen -- -W 'y n' return ;; --size | -${noargopts}L) @@ -719,7 +719,7 @@ _comp_cmd_lvcreate() return ;; --permission | -${noargopts}p) - COMPREPLY=($(compgen -W 'r rw' -- "$cur")) + _comp_compgen -- -W 'r rw' return ;; --name | -${noargopts}n) @@ -751,7 +751,7 @@ _comp_cmd_lvremove() # shellcheck disable=SC2254 case $prev in --autobackup | -${noargopts}A) - COMPREPLY=($(compgen -W 'y n' -- "$cur")) + _comp_compgen -- -W 'y n' return ;; esac @@ -773,7 +773,7 @@ _comp_cmd_lvrename() # shellcheck disable=SC2254 case $prev in --autobackup | -${noargopts}A) - COMPREPLY=($(compgen -W 'y n' -- "$cur")) + _comp_compgen -- -W 'y n' return ;; esac @@ -795,7 +795,7 @@ _comp_cmd_lvreduce() # shellcheck disable=SC2254 case $prev in --autobackup | -${noargopts}A) - COMPREPLY=($(compgen -W 'y n' -- "$cur")) + _comp_compgen -- -W 'y n' return ;; --size | -${noargopts}L) @@ -821,7 +821,7 @@ _comp_cmd_lvresize() # shellcheck disable=SC2254 case $prev in --autobackup | -${noargopts}A) - COMPREPLY=($(compgen -W 'y n' -- "$cur")) + _comp_compgen -- -W 'y n' return ;; --size | -${noargopts}L) @@ -853,7 +853,7 @@ _comp_cmd_lvextend() # shellcheck disable=SC2254 case $prev in --autobackup | -${noargopts}A) - COMPREPLY=($(compgen -W 'y n' -- "$cur")) + _comp_compgen -- -W 'y n' return ;; --size | -${noargopts}L) diff --git a/completions/mailmanctl b/completions/mailmanctl index d10ba2807ce..beb33f5e531 100644 --- a/completions/mailmanctl +++ b/completions/mailmanctl @@ -9,7 +9,7 @@ _comp_cmd_mailmanctl() COMPREPLY=($(compgen -W '--no-restart --run-as-user --stale-lock-cleanup --quiet --help' -- "$cur")) else - COMPREPLY=($(compgen -W 'start stop restart reopen' -- "$cur")) + _comp_compgen -- -W 'start stop restart reopen' fi } && diff --git a/completions/make b/completions/make index 4f3d28ddd3e..8f75c3db8b9 100644 --- a/completions/make +++ b/completions/make @@ -158,7 +158,7 @@ _comp_cmd_make() return ;; -${noargopts}E) - COMPREPLY=($(compgen -v -- "$cur")) + _comp_compgen -- -v return ;; --eval | -${noargopts}[DVx]) diff --git a/completions/makepkg b/completions/makepkg index 345d9b4711e..7ca46fe586f 100644 --- a/completions/makepkg +++ b/completions/makepkg @@ -8,7 +8,7 @@ _comp_cmd_makepkg__slackware() case "$prev" in -l | --linkadd | -c | --chown) - COMPREPLY=($(compgen -W 'y n' -- "$cur")) + _comp_compgen -- -W 'y n' return ;; esac diff --git a/completions/man b/completions/man index 7410691bdf6..1febf3ef1e2 100644 --- a/completions/man +++ b/completions/man @@ -30,11 +30,11 @@ _comp_cmd_man() ;; --pager | -${noargopts}P) compopt -o filenames - COMPREPLY=($(compgen -c -- "$cur")) + _comp_compgen -- -c return ;; --preprocessor | -${noargopts}p) - COMPREPLY=($(compgen -W 'e p t g r v' -- "$cur")) + _comp_compgen -- -W 'e p t g r v' return ;; --locale | --systems | --extension | --prompt | --recode | --encoding | \ diff --git a/completions/mcrypt b/completions/mcrypt index fcde2fd99c6..61496cc642a 100644 --- a/completions/mcrypt +++ b/completions/mcrypt @@ -8,7 +8,7 @@ _comp_cmd_mcrypt() case $prev in -g | --openpgp-z) - COMPREPLY=($(compgen -W '{0..9}' -- "$cur")) + _comp_compgen -- -W '{0..9}' return ;; -o | --keymode) diff --git a/completions/mdadm b/completions/mdadm index 657c7e54507..9a04453847f 100644 --- a/completions/mdadm +++ b/completions/mdadm @@ -48,7 +48,7 @@ _comp_cmd_mdadm__raid_layout() right-asymmetric right-symmetric la ra ls rs' -- "$cur")) ;; raid10) - COMPREPLY=($(compgen -W 'n o p' -- "$cur")) + _comp_compgen -- -W 'n o p' ;; faulty) COMPREPLY=($(compgen -W 'write-transient wt read-transient rt @@ -60,7 +60,7 @@ _comp_cmd_mdadm__raid_layout() _comp_cmd_mdadm__auto_flag() { - COMPREPLY=($(compgen -W 'no yes md mdp part p' -- "$cur")) + _comp_compgen -- -W 'no yes md mdp part p' } _comp_cmd_mdadm__update_flag() diff --git a/completions/mdtool b/completions/mdtool index d1a802d7c65..cfa1628ec3f 100644 --- a/completions/mdtool +++ b/completions/mdtool @@ -33,7 +33,7 @@ _comp_cmd_mdtool() ;; "generate-makefiles") compopt -o filenames - COMPREPLY=($(compgen -o filenames -G"*.mds" -- "$cur")) + _comp_compgen -- -o filenames -G"*.mds" if [[ $prev == *mds ]]; then COMPREPLY=($(compgen -W '--simple-makefiles --s --d:' \ -- "$cur")) diff --git a/completions/minicom b/completions/minicom index 2b0986308b4..478e7d09f71 100644 --- a/completions/minicom +++ b/completions/minicom @@ -9,7 +9,7 @@ _comp_cmd_minicom() # shellcheck disable=SC2254 case $prev in --attrib | --color | -${noargopts}[ac]) - COMPREPLY=($(compgen -W 'on off' -- "$cur")) + _comp_compgen -- -W 'on off' return ;; --script | --capturefile | -${noargopts}[SC]) @@ -36,7 +36,7 @@ _comp_cmd_minicom() local -a files _comp_expand_glob files '{/etc/,/etc/minicom/,~/.}minirc.?*' ((${#files[@]})) && - COMPREPLY=($(compgen -W '"${files[@]##*minirc.}"' -- "$cur")) + _comp_compgen -- -W '"${files[@]##*minirc.}"' } && complete -F _comp_cmd_minicom -o default minicom diff --git a/completions/mktemp b/completions/mktemp index 9ce8e5ee4aa..352288a2f1a 100644 --- a/completions/mktemp +++ b/completions/mktemp @@ -22,7 +22,7 @@ _comp_cmd_mktemp() if [[ $cur == -* ]]; then local opts=$(_parse_help "$1") [[ $opts ]] || opts="-d -u -q -p -t" # non-GNU fallback - COMPREPLY=($(compgen -W "$opts" -- "$cur")) + _comp_compgen -- -W "$opts" [[ ${COMPREPLY-} == *= ]] && compopt -o nospace fi } && diff --git a/completions/mmsitepass b/completions/mmsitepass index e69f80dc8c6..dcf38c7463a 100644 --- a/completions/mmsitepass +++ b/completions/mmsitepass @@ -6,7 +6,7 @@ _comp_cmd_mmsitepass() _comp_initialize -- "$@" || return if [[ $cur == -* ]]; then - COMPREPLY=($(compgen -W '--listcreator --help' -- "$cur")) + _comp_compgen -- -W '--listcreator --help' fi } && diff --git a/completions/modprobe b/completions/modprobe index cc4891e3f4e..cfe35e87538 100644 --- a/completions/modprobe +++ b/completions/modprobe @@ -93,7 +93,7 @@ _comp_cmd_modprobe() command grep -q "^$prev:.*(bool)"; then local choices="on off" [[ $cur ]] && choices="1 0 y Y n N on off" - COMPREPLY=($(compgen -W "$choices" -- "$cur")) + _comp_compgen -- -W "$choices" fi else COMPREPLY=($(compgen -S = -W "$(PATH="$PATH:/sbin" \ diff --git a/completions/mplayer b/completions/mplayer index ac90da3520a..7872fb33d86 100644 --- a/completions/mplayer +++ b/completions/mplayer @@ -60,9 +60,9 @@ _comp_cmd_mplayer() cp=($(iconv --list 2>/dev/null | command sed -e "s@//@@;" 2>/dev/null)) if ((${#cp[@]})); then if [[ $cur == "${cur,,}" ]]; then - COMPREPLY=($(compgen -W '"${cp[@],,}"' -- "$cur")) + _comp_compgen -- -W '"${cp[@],,}"' else - COMPREPLY=($(compgen -W '"${cp[@]^^}"' -- "$cur")) + _comp_compgen -- -W '"${cp[@]^^}"' fi fi return @@ -138,7 +138,7 @@ _comp_cmd_mplayer() return ;; -channels) - COMPREPLY=($(compgen -W '2 4 6 8' -- "$cur")) + _comp_compgen -- -W '2 4 6 8' return ;; -aspect | -monitoraspect) @@ -167,7 +167,7 @@ _comp_cmd_mplayer() return ;; -ssf) - COMPREPLY=($(compgen -W 'lgb= cgb= ls= cs= chs= cvs=' -- "$cur")) + _comp_compgen -- -W 'lgb= cgb= ls= cs= chs= cvs=' return ;; -jpeg) @@ -176,7 +176,7 @@ _comp_cmd_mplayer() return ;; -xvidopts) - COMPREPLY=($(compgen -W 'dr2 nodr2' -- "$cur")) + _comp_compgen -- -W 'dr2 nodr2' return ;; -xvidencopts) @@ -236,7 +236,7 @@ _comp_cmd_mplayer() return ;; -mf) - COMPREPLY=($(compgen -W 'on w= h= fps= type=' -- "$cur")) + _comp_compgen -- -W 'on w= h= fps= type=' return ;; -cdda) @@ -251,11 +251,11 @@ _comp_cmd_mplayer() return ;; -af-adv) - COMPREPLY=($(compgen -W 'force= list=' -- "$cur")) + _comp_compgen -- -W 'force= list=' return ;; -noconfig) - COMPREPLY=($(compgen -W 'all gui system user' -- "$cur")) + _comp_compgen -- -W 'all gui system user' return ;; -*) diff --git a/completions/mr b/completions/mr index 63aa7ab26b9..26154f6aa93 100644 --- a/completions/mr +++ b/completions/mr @@ -43,18 +43,18 @@ _comp_cmd_mr() ;; clean) if [[ ${cur} == -* ]]; then - COMPREPLY=($(compgen -W '-f' -- "${cur}")) + _comp_compgen -- -W '-f' fi return ;; commit | ci | record) if [[ ${cur} == -* ]]; then - COMPREPLY=($(compgen -W '-m' -- "${cur}")) + _comp_compgen -- -W '-m' fi return ;; run) - COMPREPLY=($(compgen -c -- "${cur}")) + _comp_compgen -- -c return ;; *) @@ -84,9 +84,9 @@ _comp_cmd_mr() options="${options//-[a-z]$'\n'/}" # Remove deprecated options. options="${options//--path/}" - COMPREPLY=($(compgen -W "${options}" -- "${cur}")) + _comp_compgen -- -W "${options}" else - COMPREPLY=($(compgen -W "${commands}" -- "${cur}")) + _comp_compgen -- -W "${commands}" fi } && complete -F _comp_cmd_mr mr diff --git a/completions/mtx b/completions/mtx index 99ec307e84c..b23280632d6 100644 --- a/completions/mtx +++ b/completions/mtx @@ -23,10 +23,10 @@ _comp_cmd_mtx() if ((cword > 1)); then case $prev in load) - COMPREPLY=($(compgen -W "$tapes" -- "$cur")) + _comp_compgen -- -W "$tapes" ;; unload | first | last | next) - COMPREPLY=($(compgen -W "$drives" -- "$cur")) + _comp_compgen -- -W "$drives" ;; -f) true @@ -36,7 +36,7 @@ _comp_cmd_mtx() ;; esac else - COMPREPLY=($(compgen -W "$options" -- "$cur")) + _comp_compgen -- -W "$options" fi } && complete -F _comp_cmd_mtx mtx diff --git a/completions/munin-node-configure b/completions/munin-node-configure index c254acef3bc..a45b3610917 100644 --- a/completions/munin-node-configure +++ b/completions/munin-node-configure @@ -19,7 +19,7 @@ _comp_cmd_munin_node_configure() return ;; --snmpversion) - COMPREPLY=($(compgen -W '1 2c 3' -- "$cur")) + _comp_compgen -- -W '1 2c 3' return ;; esac diff --git a/completions/mussh b/completions/mussh index b777d62cc0b..f3038925539 100644 --- a/completions/mussh +++ b/completions/mussh @@ -10,11 +10,11 @@ _comp_cmd_mussh() return ;; -d) - COMPREPLY=($(compgen -W '{0..2}' -- "$cur")) + _comp_compgen -- -W '{0..2}' return ;; -v) - COMPREPLY=($(compgen -W '{0..3}' -- "$cur")) + _comp_compgen -- -W '{0..3}' return ;; -i | -H | -C) @@ -26,7 +26,7 @@ _comp_cmd_mussh() return ;; -l | -L) - COMPREPLY=($(compgen -u -- "$cur")) + _comp_compgen -- -u return ;; -s) diff --git a/completions/mypy b/completions/mypy index 4e0fa12fa09..c294f14f5c4 100644 --- a/completions/mypy +++ b/completions/mypy @@ -21,7 +21,7 @@ _comp_cmd_mypy() return ;; --follow-imports) - COMPREPLY=($(compgen -W 'normal silent skip error' -- "$cur")) + _comp_compgen -- -W 'normal silent skip error' return ;; --python-executable) diff --git a/completions/mysql b/completions/mysql index 9b456714e08..50da414d745 100644 --- a/completions/mysql +++ b/completions/mysql @@ -22,7 +22,7 @@ _comp_cmd_mysql() # shellcheck disable=SC2254 case $prev in --user | -${noargopts}u) - COMPREPLY=($(compgen -u -- "$cur")) + _comp_compgen -- -u return ;; --database | -${noargopts}D) @@ -48,7 +48,7 @@ _comp_cmd_mysql() return ;; --protocol) - COMPREPLY=($(compgen -W 'tcp socket pipe memory' -- "$cur")) + _comp_compgen -- -W 'tcp socket pipe memory' return ;; --defaults-file | --defaults-extra-file | --tee) @@ -81,7 +81,7 @@ _comp_cmd_mysql() local help=$(_parse_help "$1") help+=" --skip-comments --skip-ssl" - COMPREPLY=($(compgen -W "$help" -- "$cur")) + _comp_compgen -- -W "$help" [[ ${COMPREPLY-} == *= ]] && compopt -o nospace return ;; diff --git a/completions/mysqladmin b/completions/mysqladmin index b4f7ea73ee8..68eadb7ac90 100644 --- a/completions/mysqladmin +++ b/completions/mysqladmin @@ -9,7 +9,7 @@ _comp_cmd_mysqladmin() # shellcheck disable=SC2254 case $prev in --user | -${noargopts}u) - COMPREPLY=($(compgen -u -- "$cur")) + _comp_compgen -- -u return ;; --host | -${noargopts}h) diff --git a/completions/nc b/completions/nc index 90ae9544db6..be41fca0ff9 100644 --- a/completions/nc +++ b/completions/nc @@ -25,7 +25,7 @@ _comp_cmd_nc() return ;; -*X) - COMPREPLY=($(compgen -W '4 5 connect' -- "$cur")) + _comp_compgen -- -W '4 5 connect' return ;; -*x) diff --git a/completions/newusers b/completions/newusers index a2169888770..e7476f4c090 100644 --- a/completions/newusers +++ b/completions/newusers @@ -7,7 +7,7 @@ _comp_cmd_newusers() case $prev in -c | --crypt) - COMPREPLY=($(compgen -W 'DES MD5 NONE SHA256 SHA512' -- "$cur")) + _comp_compgen -- -W 'DES MD5 NONE SHA256 SHA512' return ;; -s | --sha-rounds) diff --git a/completions/ngrep b/completions/ngrep index d9a8ee6aadc..dbb86281296 100644 --- a/completions/ngrep +++ b/completions/ngrep @@ -19,7 +19,7 @@ _comp_cmd_ngrep() return ;; -W) - COMPREPLY=($(compgen -W 'normal byline single none' -- "$cur")) + _comp_compgen -- -W 'normal byline single none' return ;; -F) diff --git a/completions/nslookup b/completions/nslookup index 8b7b59e7488..3b17d7a8aab 100644 --- a/completions/nslookup +++ b/completions/nslookup @@ -76,7 +76,7 @@ _comp_cmd_host() return ;; -m) - COMPREPLY=($(compgen -W 'trace record usage' -- "$cur")) + _comp_compgen -- -W 'trace record usage' return ;; -N | -R | -W) diff --git a/completions/ntpdate b/completions/ntpdate index 0ac1ed389d7..730778e9ca6 100644 --- a/completions/ntpdate +++ b/completions/ntpdate @@ -11,11 +11,11 @@ _comp_cmd_ntpdate() return ;; -*U) - COMPREPLY=($(compgen -u -- "$cur")) + _comp_compgen -- -u return ;; -*p) - COMPREPLY=($(compgen -W '{1..8}' -- "$cur")) + _comp_compgen -- -W '{1..8}' return ;; diff --git a/completions/oggdec b/completions/oggdec index 19ef8c10d64..bdf291b87a9 100644 --- a/completions/oggdec +++ b/completions/oggdec @@ -12,11 +12,11 @@ _comp_cmd_oggdec() return ;; --bits | -${noargopts}b) - COMPREPLY=($(compgen -W "8 16" -- "$cur")) + _comp_compgen -- -W "8 16" return ;; --endianness | --sign | -${noargopts}[es]) - COMPREPLY=($(compgen -W "0 1" -- "$cur")) + _comp_compgen -- -W "0 1" return ;; --output | -${noargopts}o) diff --git a/completions/openssl b/completions/openssl index 40d44c9ffdf..911e88c8246 100644 --- a/completions/openssl +++ b/completions/openssl @@ -57,7 +57,7 @@ _comp_cmd_openssl() sha224 sha256 sha384 sha512 genpkey pkey pkeyparam pkeyutl' if ((cword == 1)); then - COMPREPLY=($(compgen -W "$commands" -- "$cur")) + _comp_compgen -- -W "$commands" else command=${words[1]} case $prev in @@ -91,7 +91,7 @@ _comp_cmd_openssl() formats+=" ENGINE" ;; esac - COMPREPLY=($(compgen -W "$formats" -- "$cur")) + _comp_compgen -- -W "$formats" return ;; -connect) @@ -110,7 +110,7 @@ _comp_cmd_openssl() return ;; -kdf) - COMPREPLY=($(compgen -W 'TLS1-PRF HKDF' -- "$cur")) + _comp_compgen -- -W 'TLS1-PRF HKDF' return ;; esac @@ -121,7 +121,7 @@ _comp_cmd_openssl() case $command in dgst | req | x509) options+=" $(_openssl_digests "$1")" ;; esac - COMPREPLY=($(compgen -W "$options" -- "$cur")) + _comp_compgen -- -W "$options" else if [[ $command == speed ]]; then COMPREPLY=($(compgen -W 'md2 mdc2 md5 hmac sha1 rmd160 diff --git a/completions/opera b/completions/opera index 50697b48e80..5e3a22d8bdd 100644 --- a/completions/opera +++ b/completions/opera @@ -23,7 +23,7 @@ _comp_cmd_opera() return ;; ?(-)-windowname) - COMPREPLY=($(compgen -W 'first last opera{1..9}' -- "$cur")) + _comp_compgen -- -W 'first last opera{1..9}' return ;; ?(-)-geometry | ?(-)-window | ?(-)-display | ?(-)-urllistloadtimeout | \ diff --git a/completions/optipng b/completions/optipng index dae68e16164..1187320dd0d 100644 --- a/completions/optipng +++ b/completions/optipng @@ -10,7 +10,7 @@ _comp_cmd_optipng() return ;; -o) - COMPREPLY=($(compgen -W '{0..7}' -- "$cur")) + _comp_compgen -- -W '{0..7}' return ;; -out | -log) @@ -22,11 +22,11 @@ _comp_cmd_optipng() return ;; -i) - COMPREPLY=($(compgen -W '0 1' -- "$cur")) + _comp_compgen -- -W '0 1' return ;; -zc | -zm) - COMPREPLY=($(compgen -W '{1..9}' -- "$cur")) + _comp_compgen -- -W '{1..9}' return ;; -zw) @@ -35,7 +35,7 @@ _comp_cmd_optipng() return ;; -strip) - COMPREPLY=($(compgen -W 'all' -- "$cur")) + _comp_compgen -- -W 'all' return ;; esac diff --git a/completions/p4 b/completions/p4 index c2767b37ff9..ce2b57b6f8b 100644 --- a/completions/p4 +++ b/completions/p4 @@ -15,7 +15,7 @@ _comp_cmd_p4() text binary resource" if ((cword == 1)); then - COMPREPLY=($(compgen -W "$p4commands" -- "$cur")) + _comp_compgen -- -W "$p4commands" elif ((cword == 2)); then case $prev in help) @@ -24,7 +24,7 @@ _comp_cmd_p4() -- "$cur")) ;; admin) - COMPREPLY=($(compgen -W "checkpoint stop" -- "$cur")) + _comp_compgen -- -W "checkpoint stop" ;; *) ;; @@ -34,7 +34,7 @@ _comp_cmd_p4() -t) case ${words[cword - 2]} in add | edit | reopen) - COMPREPLY=($(compgen -W "$p4filetypes" -- "$cur")) + _comp_compgen -- -W "$p4filetypes" ;; *) ;; diff --git a/completions/pack200 b/completions/pack200 index 520e432e980..384a9f907fe 100644 --- a/completions/pack200 +++ b/completions/pack200 @@ -12,19 +12,19 @@ _comp_cmd_pack200() return ;; -E | --effort) - COMPREPLY=($(compgen -W '{0..9}' -- "$cur")) + _comp_compgen -- -W '{0..9}' return ;; -H | --deflate-hint) - COMPREPLY=($(compgen -W 'true false keep' -- "$cur")) + _comp_compgen -- -W 'true false keep' return ;; -m | --modification-time) - COMPREPLY=($(compgen -W 'latest keep' -- "$cur")) + _comp_compgen -- -W 'latest keep' return ;; -U | --unknown-attribute) - COMPREPLY=($(compgen -W 'error strip pass' -- "$cur")) + _comp_compgen -- -W 'error strip pass' return ;; -f | --config-file) @@ -32,7 +32,7 @@ _comp_cmd_pack200() return ;; -l | --log-file) - COMPREPLY=($(compgen -W '-' -- "$cur")) + _comp_compgen -- -W '-' _comp_compgen -a filedir log return ;; diff --git a/completions/patch b/completions/patch index 3107b55cc13..a273eb94664 100644 --- a/completions/patch +++ b/completions/patch @@ -13,7 +13,7 @@ _comp_cmd_patch() return ;; --fuzz | -${noargopts}F) - COMPREPLY=($(compgen -W '{0..3}' -- "$cur")) + _comp_compgen -- -W '{0..3}' return ;; --input | -${noargopts}i) @@ -31,7 +31,7 @@ _comp_cmd_patch() return ;; --version-control | -${noargopts}V) - COMPREPLY=($(compgen -W 'simple numbered existing' -- "$cur")) + _comp_compgen -- -W 'simple numbered existing' return ;; --directory | -${noargopts}d) @@ -39,11 +39,11 @@ _comp_cmd_patch() return ;; --reject-format) - COMPREPLY=($(compgen -W 'context unified' -- "$cur")) + _comp_compgen -- -W 'context unified' return ;; --read-only) - COMPREPLY=($(compgen -W 'ignore warn fail' -- "$cur")) + _comp_compgen -- -W 'ignore warn fail' return ;; esac diff --git a/completions/pdftoppm b/completions/pdftoppm index 13e72ad5dca..27ff058103a 100644 --- a/completions/pdftoppm +++ b/completions/pdftoppm @@ -10,15 +10,15 @@ _comp_cmd_pdftoppm() return ;; -tiffcompression) - COMPREPLY=($(compgen -W 'none packbits jpeg lzw deflate' -- "$cur")) + _comp_compgen -- -W 'none packbits jpeg lzw deflate' return ;; -freetype | -aa | -aaVector) - COMPREPLY=($(compgen -W 'yes no' -- "$cur")) + _comp_compgen -- -W 'yes no' return ;; -thinlinemode) - COMPREPLY=($(compgen -W 'none solid shape' -- "$cur")) + _comp_compgen -- -W 'none solid shape' return ;; esac diff --git a/completions/pdftotext b/completions/pdftotext index a79e12c1e3b..d1d0b2caf50 100644 --- a/completions/pdftotext +++ b/completions/pdftotext @@ -16,7 +16,7 @@ _comp_cmd_pdftotext() return ;; -eol) - COMPREPLY=($(compgen -W "unix dos mac" -- "$cur")) + _comp_compgen -- -W "unix dos mac" return ;; esac @@ -29,7 +29,7 @@ _comp_cmd_pdftotext() case ${prev,,} in - | *.txt) ;; *.pdf) - COMPREPLY=($(compgen -W '-' -- "$cur")) + _comp_compgen -- -W '-' _comp_compgen -a filedir txt ;; *) _comp_compgen_filedir pdf ;; diff --git a/completions/perl b/completions/perl index bd408a6af05..7356e85e6f4 100644 --- a/completions/perl +++ b/completions/perl @@ -35,7 +35,7 @@ _comp_cmd_perl() -*[Ix]) local IFS=$'\n' compopt -o filenames - COMPREPLY=($(compgen -d "$optPrefix" $optSuffix -- "$cur")) + _comp_compgen -- -d "$optPrefix" $optSuffix return ;; -*[mM]) @@ -81,7 +81,7 @@ _comp_cmd_perl() local IFS=$'\n' compopt -o filenames # shellcheck disable=SC2086 - COMPREPLY=($(compgen -d ${optPrefix-} ${optSuffix-} -- "$cur")) + _comp_compgen -- -d ${optPrefix-} ${optSuffix-} return elif [[ $cur == -* ]]; then diff --git a/completions/perlcritic b/completions/perlcritic index 42385c83377..9014f5a129d 100644 --- a/completions/perlcritic +++ b/completions/perlcritic @@ -25,16 +25,16 @@ _comp_cmd_perlcritic() return ;; --profile-strictness) - COMPREPLY=($(compgen -W 'warn fatal quiet' -- "$cur")) + _comp_compgen -- -W 'warn fatal quiet' return ;; --verbose) - COMPREPLY=($(compgen -W '{1..11}' -- "$cur")) + _comp_compgen -- -W '{1..11}' return ;; --pager) compopt -o filenames - COMPREPLY=($(compgen -c -- "$cur")) + _comp_compgen -- -c return ;; esac diff --git a/completions/pgrep b/completions/pgrep index 5dfcc69691d..bbb5b2fb549 100644 --- a/completions/pgrep +++ b/completions/pgrep @@ -24,7 +24,7 @@ _comp_cmd_pgrep() return ;; -j) - COMPREPLY=($(compgen -W 'any none' -- "$cur")) + _comp_compgen -- -W 'any none' return ;; --parent | --ns | -${noargopts}P) @@ -52,7 +52,7 @@ _comp_cmd_pgrep() [[ $help ]] || help='$("$1" --usage 2>&1 | command sed -e "s/\[-signal\]//" -e "s/\[-SIGNAL\]//" | _parse_usage -)' - COMPREPLY=($(compgen -W "$help" -- "$cur")) + _comp_compgen -- -W "$help" [[ $cword -eq 1 && $1 == *pkill ]] && _signals - return fi diff --git a/completions/ping b/completions/ping index 9e01a34f32e..5b00de4f7cd 100644 --- a/completions/ping +++ b/completions/ping @@ -19,7 +19,7 @@ _comp_cmd_ping() # Path MTU strategy in Linux, mask|time in FreeBSD local opts="do want dont" [[ $OSTYPE == *bsd* ]] && opts="mask time" - COMPREPLY=($(compgen -W '$opts' -- "$cur")) + _comp_compgen -- -W '$opts' return ;; -*N) @@ -34,7 +34,7 @@ _comp_cmd_ping() -*Q) # TOS in Linux, "somewhat quiet" (no args) in FreeBSD if [[ $OSTYPE != *bsd* ]]; then - COMPREPLY=($(compgen -W '{0..7}' -- "$cur")) + _comp_compgen -- -W '{0..7}' return fi ;; @@ -46,7 +46,7 @@ _comp_cmd_ping() -*T) # Timestamp option in Linux, TTL in FreeBSD [[ $OSTYPE == *bsd* ]] || - COMPREPLY=($(compgen -W 'tsonly tsandaddr' -- "$cur")) + _comp_compgen -- -W 'tsonly tsandaddr' return ;; -*4*) diff --git a/completions/pkg-get b/completions/pkg-get index 13c33f71349..5563e49df75 100644 --- a/completions/pkg-get +++ b/completions/pkg-get @@ -50,7 +50,7 @@ _comp_cmd_pkg_get__catalog_file() _comp_cmd_pkg_get__catalog_file "$url" if [[ -f $ret ]]; then local packages_list=$(awk '$0 ~ /BEGIN PGP SIGNATURE/ { exit } $1 ~ /^Hash:/ || $1 ~ /^ *(-|#|$)/ { next } { print $1 }' "$ret") - COMPREPLY=($(compgen -W "${packages_list}" -- "${cur}")) + _comp_compgen -- -W "${packages_list}" fi fi return @@ -58,14 +58,14 @@ _comp_cmd_pkg_get__catalog_file() if [[ ${cur} == -* ]]; then local -a opts=(-c -d -D -f -i -l -s -S -u -U -v) - COMPREPLY=($(compgen -W '"${opts[@]}"' -- "${cur}")) + _comp_compgen -- -W '"${opts[@]}"' return fi local -a commands=( available describe download install list updatecatalog upgrade ) - COMPREPLY=($(compgen -W '"${commands[@]}"' -- "${cur}")) + _comp_compgen -- -W '"${commands[@]}"' } && complete -F _comp_cmd_pkg_get pkg-get diff --git a/completions/pkgadd b/completions/pkgadd index 7df659ee4d4..0eba945724a 100644 --- a/completions/pkgadd +++ b/completions/pkgadd @@ -36,7 +36,7 @@ _comp_cmd_pkgadd() *) if [[ ${cur} == -* ]]; then local -a opts=(-a -A -d -k -n -M -P -r -R -s -v -V -x) - COMPREPLY=($(compgen -W '"${opts[@]}"' -- "${cur}")) + _comp_compgen -- -W '"${opts[@]}"' else local -a pkginst_list if [[ -d $device ]]; then @@ -52,7 +52,7 @@ _comp_cmd_pkgadd() command sed -n 's/^PKG=//p' | sort -u)" fi ((${#pkginst_list[@]})) && - COMPREPLY=($(compgen -W '"${pkginst_list[@]}"' -- "${cur}")) + _comp_compgen -- -W '"${pkginst_list[@]}"' fi ;; esac diff --git a/completions/pkgrm b/completions/pkgrm index d22567f8713..b679c03ab33 100644 --- a/completions/pkgrm +++ b/completions/pkgrm @@ -34,7 +34,7 @@ _comp_cmd_pkgrm() *) if [[ ${cur} == -* ]]; then local opts="-a -A -n -M -R -s -v -V -Y" - COMPREPLY=($(compgen -W "${opts}" -- "${cur}")) + _comp_compgen -- -W "${opts}" else COMPREPLY=($(compgen -W "$(/bin/ls -1 "$spool")" -- "${cur}")) fi diff --git a/completions/pkgutil b/completions/pkgutil index 78c4f95d1ac..295367a7b8f 100644 --- a/completions/pkgutil +++ b/completions/pkgutil @@ -87,7 +87,7 @@ _comp_cmd_pkgutil() if [[ $command == -@([dius]|-download|-install|-upgrade|-stream) ]]; then local packages_list=$(awk ' $0 ~ /BEGIN PGP SIGNATURE/ { exit } $1 ~ /^Hash:/ || $1 ~ /^ *(-|#|$)/ { next } { print $1 }' "${catalog_files[@]}") - COMPREPLY=($(compgen -W "${packages_list}" -- "$cur")) + _comp_compgen -- -W "${packages_list}" elif [[ $command == @(-r|--remove) ]]; then local packages_list=$( @@ -95,7 +95,7 @@ _comp_cmd_pkgutil() ) packages_list=${packages_list%|} packages_list=$(nawk " \$3 ~ /^$packages_list\$/ { print \$1 }" "${catalog_files[@]}") - COMPREPLY=($(compgen -W "${packages_list}" -- "$cur")) + _comp_compgen -- -W "${packages_list}" fi return fi @@ -108,7 +108,7 @@ _comp_cmd_pkgutil() --findfile --deptree --extract --stream --output --target --single --param --parse --cleanup --catinfo ) - COMPREPLY=($(compgen -W '"${commands[@]}"' -- "$cur")) + _comp_compgen -- -W '"${commands[@]}"' } && complete -F _comp_cmd_pkgutil pkgutil diff --git a/completions/pm-powersave b/completions/pm-powersave index 21d67699a7e..0db0ddc8fc0 100644 --- a/completions/pm-powersave +++ b/completions/pm-powersave @@ -5,7 +5,7 @@ _comp_cmd_pm_powersave() local cur prev words cword comp_args _comp_initialize -- "$@" || return - COMPREPLY=($(compgen -W "true false" -- "$cur")) + _comp_compgen -- -W "true false" } && complete -F _comp_cmd_pm_powersave pm-powersave diff --git a/completions/portsnap b/completions/portsnap index 673a18f9ea3..a5f880c4040 100644 --- a/completions/portsnap +++ b/completions/portsnap @@ -18,7 +18,7 @@ _comp_cmd_portsnap() ;; esac - COMPREPLY=($(compgen -W "fetch cron extract update" -- "$cur")) + _comp_compgen -- -W "fetch cron extract update" } && complete -F _comp_cmd_portsnap portsnap diff --git a/completions/postfix b/completions/postfix index cb7b606fff3..caa9b3d7472 100644 --- a/completions/postfix +++ b/completions/postfix @@ -11,7 +11,7 @@ _comp_cmd_postfix() return ;; -D) - COMPREPLY=($(compgen -W 'start' -- "$cur")) + _comp_compgen -- -W 'start' return ;; esac diff --git a/completions/postmap b/completions/postmap index aa6b8d7c8f0..4910589869a 100644 --- a/completions/postmap +++ b/completions/postmap @@ -32,7 +32,7 @@ _comp_cmd_postmap() done if [[ ! ${COMPREPLY-} ]]; then compopt -o filenames - COMPREPLY=($(compgen -f -- "$cur")) + _comp_compgen -- -f fi fi } && diff --git a/completions/postsuper b/completions/postsuper index 6420c23048a..062ae4bfc2b 100644 --- a/completions/postsuper +++ b/completions/postsuper @@ -50,7 +50,7 @@ _comp_cmd_postsuper() return fi - COMPREPLY=($(compgen -W 'hold incoming active deferred' -- "$cur")) + _comp_compgen -- -W 'hold incoming active deferred' } && complete -F _comp_cmd_postsuper postsuper diff --git a/completions/printenv b/completions/printenv index 526f1a0cab0..9f441840971 100644 --- a/completions/printenv +++ b/completions/printenv @@ -16,7 +16,7 @@ _comp_cmd_printenv() return fi - COMPREPLY=($(compgen -v -- "$cur")) + _comp_compgen -- -v } && complete -F _comp_cmd_printenv printenv diff --git a/completions/protoc b/completions/protoc index d275c73bfb8..afb92466bf4 100644 --- a/completions/protoc +++ b/completions/protoc @@ -14,13 +14,13 @@ _comp_cmd_protoc() return ;; --error_format) - COMPREPLY=($(compgen -W 'gcc msvs' -- "$cur")) + _comp_compgen -- -W 'gcc msvs' return ;; --plugin) if [[ $cur != *=* ]]; then compopt -o filenames - COMPREPLY=($(compgen -c -- "$cur")) + _comp_compgen -- -c fi return ;; diff --git a/completions/ps b/completions/ps index a89ab8e5ae1..eb7b9089288 100644 --- a/completions/ps +++ b/completions/ps @@ -19,7 +19,7 @@ _comp_cmd_ps() return ;; -[Gg] | --[Gg]roup) - COMPREPLY=($(compgen -g -- "$cur")) + _comp_compgen -- -g return ;; ?(-)p | [^-]*p | --pid) @@ -46,7 +46,7 @@ _comp_cmd_ps() return ;; ?(-)U | [^-]*U | -u | --[Uu]ser) - COMPREPLY=($(compgen -u -- "$cur")) + _comp_compgen -- -u return ;; --format | ?(-)[Oo] | [^-]*[Oo]) diff --git a/completions/psql b/completions/psql index 01d59b9c36c..7af771a0e87 100644 --- a/completions/psql +++ b/completions/psql @@ -13,7 +13,7 @@ _comp_cmd_psql__users() # -w was introduced in 8.4, https://launchpad.net/bugs/164772 COMPREPLY=($(compgen -W "$(psql -XAtqwc 'select usename from pg_user' \ template1 2>/dev/null)" -- "$cur")) - ((${#COMPREPLY[@]} == 0)) && COMPREPLY=($(compgen -u -- "$cur")) + ((${#COMPREPLY[@]} == 0)) && _comp_compgen -- -u } # createdb(1) completion diff --git a/completions/puppet b/completions/puppet index 0e5bb0d17db..b94785e1aa8 100644 --- a/completions/puppet +++ b/completions/puppet @@ -3,16 +3,16 @@ _comp_cmd_puppet__logdest() { if [[ ! $cur ]]; then - COMPREPLY=($(compgen -W 'syslog console /' -- "$cur")) + _comp_compgen -- -W 'syslog console /' else - COMPREPLY=($(compgen -W 'syslog console' -- "$cur")) + _comp_compgen -- -W 'syslog console' _comp_compgen -a filedir fi } _comp_cmd_puppet__digest() { - COMPREPLY=($(compgen -W 'MD5 MD2 SHA1 SHA256' -- "$cur")) + _comp_compgen -- -W 'MD5 MD2 SHA1 SHA256' } _comp_cmd_puppet__certs() @@ -140,11 +140,11 @@ _comp_cmd_puppet() return ;; --masterport) - COMPREPLY=($(compgen -W '8140' -- "$cur")) + _comp_compgen -- -W '8140' return ;; -w | --waitforcert) - COMPREPLY=($(compgen -W '0 15 30 60 120' -- "$cur")) + _comp_compgen -- -W '0 15 30 60 120' return ;; *) @@ -158,7 +158,7 @@ _comp_cmd_puppet() apply) case $prev in --catalog) - COMPREPLY=($(compgen -W '-' -- "$cur")) + _comp_compgen -- -W '-' _comp_compgen -a filedir json return ;; @@ -233,7 +233,7 @@ _comp_cmd_puppet() return ;; -m | --mode) - COMPREPLY=($(compgen -W 'text trac pdf rdoc' -- "$cur")) + _comp_compgen -- -W 'text trac pdf rdoc' return ;; -r | --reference) @@ -316,7 +316,7 @@ _comp_cmd_puppet() return ;; *) - COMPREPLY=($(compgen -W 'validate' -- "$cur")) + _comp_compgen -- -W 'validate' return ;; esac diff --git a/completions/pwdx b/completions/pwdx index 110de83b1df..f77dcd7b672 100644 --- a/completions/pwdx +++ b/completions/pwdx @@ -14,7 +14,7 @@ _comp_cmd_pwdx() if [[ $cur == -* ]]; then local help=$(_parse_help "$1") [[ $help ]] || help=-V - COMPREPLY=($(compgen -W '$help' -- "$cur")) + _comp_compgen -- -W '$help' else _pids fi diff --git a/completions/pycodestyle b/completions/pycodestyle index 3034611c475..7ef74fe8962 100644 --- a/completions/pycodestyle +++ b/completions/pycodestyle @@ -10,7 +10,7 @@ _comp_cmd_pycodestyle() return ;; --format) - COMPREPLY=($(compgen -W 'default pylint' -- "$cur")) + _comp_compgen -- -W 'default pylint' return ;; --config) diff --git a/completions/pydoc b/completions/pydoc index 46144e98e08..96fe088809a 100644 --- a/completions/pydoc +++ b/completions/pydoc @@ -22,7 +22,7 @@ _comp_cmd_pydoc() return fi - COMPREPLY=($(compgen -W 'keywords topics modules' -- "$cur")) + _comp_compgen -- -W 'keywords topics modules' if ! _comp_looks_like_path "$cur"; then local python=python diff --git a/completions/pydocstyle b/completions/pydocstyle index 58791edceaf..f36bfedde51 100644 --- a/completions/pydocstyle +++ b/completions/pydocstyle @@ -15,7 +15,7 @@ _comp_cmd_pydocstyle() return ;; --convention) - COMPREPLY=($(compgen -W "pep257 numpy" -- "$cur")) + _comp_compgen -- -W "pep257 numpy" return ;; esac diff --git a/completions/pylint b/completions/pylint index 5698b8f12ad..c35f536d876 100644 --- a/completions/pylint +++ b/completions/pylint @@ -68,7 +68,7 @@ _comp_cmd_pylint() --reports | --comment | --ignore-comments | --ignore-docstrings | \ --ignore-imports | --init-import | --ignore-mixin-members | \ --zope | --suggestion-mode | -${noargopts}[isr]) - COMPREPLY=($(compgen -W 'yes no' -- "$cur")) + _comp_compgen -- -W 'yes no' return ;; --load-plugins | --deprecated-modules) diff --git a/completions/pytest b/completions/pytest index 62e41ea09ff..af16d1b6573 100644 --- a/completions/pytest +++ b/completions/pytest @@ -21,15 +21,15 @@ _comp_cmd_pytest() return ;; --import-mode) - COMPREPLY=($(compgen -W "prepend append" -- "$cur")) + _comp_compgen -- -W "prepend append" return ;; --capture) - COMPREPLY=($(compgen -W "fd sys no tee-sys" -- "$cur")) + _comp_compgen -- -W "fd sys no tee-sys" return ;; --lfnf | --last-failed-no-failures) - COMPREPLY=($(compgen -W "all none" -- "$cur")) + _comp_compgen -- -W "all none" return ;; --tb) @@ -38,15 +38,15 @@ _comp_cmd_pytest() return ;; --show-capture) - COMPREPLY=($(compgen -W "no stdout stderr log all" -- "$cur")) + _comp_compgen -- -W "no stdout stderr log all" return ;; --color) - COMPREPLY=($(compgen -W "yes no auto" -- "$cur")) + _comp_compgen -- -W "yes no auto" return ;; --pastebin) - COMPREPLY=($(compgen -W "failed all" -- "$cur")) + _comp_compgen -- -W "failed all" return ;; --junit-xml) @@ -72,7 +72,7 @@ _comp_cmd_pytest() return ;; --assert) - COMPREPLY=($(compgen -W "plain reinterp rewrite" -- "$cur")) + _comp_compgen -- -W "plain reinterp rewrite" return ;; --genscript) diff --git a/completions/python b/completions/python index d317c4b801a..be042fdc426 100644 --- a/completions/python +++ b/completions/python @@ -58,7 +58,7 @@ _comp_cmd_python() ;; --jit) # TODO: quite a few others, parse from "--jit help" output? - COMPREPLY=($(compgen -W "help off" -- "$cur")) + _comp_compgen -- -W "help off" return ;; !(?(*/)python*([0-9.])|?(*/)pypy*([0-9.])|-?)) diff --git a/completions/qemu b/completions/qemu index 6022bdf12eb..6e2c46953b2 100644 --- a/completions/qemu +++ b/completions/qemu @@ -16,14 +16,14 @@ _comp_cmd_qemu() return ;; -boot) - COMPREPLY=($(compgen -W 'a c d n' -- "$cur")) + _comp_compgen -- -W 'a c d n' return ;; -k) local -a keymaps _comp_expand_glob keymaps '/usr/{local/,}share/qemu/keymaps/!(common|modifiers)' ((${#keymaps[@]})) && - COMPREPLY=($(compgen -W '"${keymaps[@]##*/}"}' -- "$cur")) + _comp_compgen -- -W '"${keymaps[@]##*/}"}' return ;; -soundhw) @@ -57,15 +57,15 @@ _comp_cmd_qemu() return ;; -redir) - COMPREPLY=($(compgen -S":" -W 'tcp udp' -- "$cur")) + _comp_compgen -- -S":" -W 'tcp udp' return ;; -bt) - COMPREPLY=($(compgen -W 'hci vhci device' -- "$cur")) + _comp_compgen -- -W 'hci vhci device' return ;; -vga) - COMPREPLY=($(compgen -W 'cirrus std vmware xenfb none' -- "$cur")) + _comp_compgen -- -W 'cirrus std vmware xenfb none' return ;; -drive) @@ -74,11 +74,11 @@ _comp_cmd_qemu() return ;; -balloon) - COMPREPLY=($(compgen -W 'none virtio' -- "$cur")) + _comp_compgen -- -W 'none virtio' return ;; -smbios) - COMPREPLY=($(compgen -W 'file type' -- "$cur")) + _comp_compgen -- -W 'file type' return ;; -watchdog) diff --git a/completions/querybts b/completions/querybts index 95358d4647e..bdd30d99d5e 100644 --- a/completions/querybts +++ b/completions/querybts @@ -14,12 +14,12 @@ _comp_cmd_querybts() return ;; --ui | --interface | -${noargopts}u) - COMPREPLY=($(compgen -W "newt text gnome" -- "$cur")) + _comp_compgen -- -W "newt text gnome" return ;; --mbox-reader-cmd) compopt -o filenames - COMPREPLY=($(compgen -c -- "$cur")) + _comp_compgen -- -c return ;; esac diff --git a/completions/quota b/completions/quota index 99303b826f2..37ad0cea405 100644 --- a/completions/quota +++ b/completions/quota @@ -7,13 +7,13 @@ _comp_cmd_quota__user_or_group() # complete on groups if -g was given for ((i = 1; i < cword; i++)); do if [[ ${words[i]} == -@(g|-group) ]]; then - COMPREPLY=($(compgen -g -- "$cur")) + _comp_compgen -- -g return fi done # otherwise complete on users - COMPREPLY=($(compgen -u -- "$cur")) + _comp_compgen -- -u } _comp_cmd_quota__parse_help() @@ -26,7 +26,7 @@ _comp_cmd_quota__parse_help() _comp_cmd_quota__formats() { - COMPREPLY=($(compgen -W 'vfsold vfsv0 rpc xfs' -- "$cur")) + _comp_compgen -- -W 'vfsold vfsv0 rpc xfs' } _comp_cmd_quota__filesystems() @@ -171,7 +171,7 @@ _comp_cmd_quotaon() return ;; -x | --xfs-command) - COMPREPLY=($(compgen -W 'delete enforce' -- "$cur")) + _comp_compgen -- -W 'delete enforce' return ;; -h | --help | -V | --version) diff --git a/completions/radvdump b/completions/radvdump index 99c83b451d7..ade2ad44d98 100644 --- a/completions/radvdump +++ b/completions/radvdump @@ -10,7 +10,7 @@ _comp_cmd_radvdump() return ;; -d | --debug) - COMPREPLY=($(compgen -W '{1..4}' -- "$cur")) + _comp_compgen -- -W '{1..4}' return ;; esac diff --git a/completions/rdesktop b/completions/rdesktop index b508c355206..833d060a735 100644 --- a/completions/rdesktop +++ b/completions/rdesktop @@ -13,15 +13,15 @@ _comp_cmd_rdesktop() COMPREPLY+=($(command ls "$HOME/.rdesktop/keymaps" 2>/dev/null)) COMPREPLY+=($(command ls ./keymaps 2>/dev/null)) ((${#COMPREPLY[@]})) && - COMPREPLY=($(compgen -W '"${COMPREPLY[@]}"' -- "$cur")) + _comp_compgen -- -W '"${COMPREPLY[@]}"' return ;; -*a) - COMPREPLY=($(compgen -W '8 15 16 24' -- "$cur")) + _comp_compgen -- -W '8 15 16 24' return ;; -*x) - COMPREPLY=($(compgen -W 'broadband modem lan' -- "$cur")) + _comp_compgen -- -W 'broadband modem lan' return ;; -*r) @@ -48,7 +48,7 @@ _comp_cmd_rdesktop() if [[ $cur == -* ]]; then local opts=($(_parse_help "$1")) ((${#opts[@]})) && - COMPREPLY=($(compgen -W '"${opts[@]%:}"}' -- "$cur")) + _comp_compgen -- -W '"${opts[@]%:}"}' else _known_hosts_real -- "$cur" fi diff --git a/completions/removepkg b/completions/removepkg index 660f15d9bce..1f780e50069 100644 --- a/completions/removepkg +++ b/completions/removepkg @@ -5,7 +5,7 @@ _comp_cmd_removepkg() local cur prev words cword comp_args _comp_initialize -- "$@" || return if [[ $cur == -* ]]; then - COMPREPLY=($(compgen -W '-copy -keep -preserve -warn' -- "$cur")) + _comp_compgen -- -W '-copy -keep -preserve -warn' return fi diff --git a/completions/reportbug b/completions/reportbug index b06c1e54abb..9497475edb4 100644 --- a/completions/reportbug +++ b/completions/reportbug @@ -39,7 +39,7 @@ _comp_cmd_reportbug() ;; --editor | --mua | --mbox-reader-cmd | -${noargopts}e) compopt -o filenames - COMPREPLY=($(compgen -c -- "$cur")) + _comp_compgen -- -c return ;; --from-buildd) diff --git a/completions/resolvconf b/completions/resolvconf index c2621d3ff91..45b47ebf828 100644 --- a/completions/resolvconf +++ b/completions/resolvconf @@ -13,7 +13,7 @@ _comp_cmd_resolvconf() esac if [[ $cur == -* ]]; then - COMPREPLY=($(compgen -W '-a -d -u' -- "$cur")) + _comp_compgen -- -W '-a -d -u' fi } && complete -F _comp_cmd_resolvconf resolvconf diff --git a/completions/ri b/completions/ri index 6142f00dbb5..ebe24816de5 100644 --- a/completions/ri +++ b/completions/ri @@ -45,7 +45,7 @@ _comp_cmd_ri() return ;; --format | -${noargopts}f) - COMPREPLY=($(compgen -W 'ansi bs html rdoc' -- "$cur")) + _comp_compgen -- -W 'ansi bs html rdoc' return ;; --doc-dir | -${noargopts}d) @@ -107,7 +107,7 @@ _comp_cmd_ri() fi ((${#classes[@]})) && - COMPREPLY=($(compgen -W '"${classes[@]}"' -- "$cur")) + _comp_compgen -- -W '"${classes[@]}"' _comp_ltrim_colon_completions "$cur" if [[ $cur == [A-Z]* ]]; then diff --git a/completions/rmlist b/completions/rmlist index b5cc2019c4e..6c1ed4fb00d 100644 --- a/completions/rmlist +++ b/completions/rmlist @@ -6,7 +6,7 @@ _comp_cmd_rmlist() _comp_initialize -- "$@" || return if [[ $cur == -* ]]; then - COMPREPLY=($(compgen -W '--archives --help' -- "$cur")) + _comp_compgen -- -W '--archives --help' else _comp_xfunc list_lists mailman_lists fi diff --git a/completions/route b/completions/route index e4b1bb214c6..99d2c76d822 100644 --- a/completions/route +++ b/completions/route @@ -24,7 +24,7 @@ _comp_cmd_route() done ((${#COMPREPLY[@]})) && - COMPREPLY=($(compgen -W '"${COMPREPLY[@]}"' -- "$cur")) + _comp_compgen -- -W '"${COMPREPLY[@]}"' } && complete -F _comp_cmd_route route diff --git a/completions/rpcdebug b/completions/rpcdebug index ae642698c39..d200d8e747c 100644 --- a/completions/rpcdebug +++ b/completions/rpcdebug @@ -32,7 +32,7 @@ _comp_cmd_rpcdebug() return ;; -*m) - COMPREPLY=($(compgen -W 'rpc nfs nfsd nlm' -- "$cur")) + _comp_compgen -- -W 'rpc nfs nfsd nlm' return ;; esac diff --git a/completions/rpm b/completions/rpm index 851558b1ece..5bf85b31404 100644 --- a/completions/rpm +++ b/completions/rpm @@ -61,7 +61,7 @@ _comp_cmd_rpm() -- "$cur")) ;; *) - COMPREPLY=($(compgen -W '-e -E -F -i -q -t -U -V' -- "$cur")) + _comp_compgen -- -W '-e -E -F -i -q -t -U -V' ;; esac return @@ -80,7 +80,7 @@ _comp_cmd_rpm() ;; --pipe) compopt -o filenames - COMPREPLY=($(compgen -c -- "$cur")) + _comp_compgen -- -c return ;; --rcfile) diff --git a/completions/rpm2tgz b/completions/rpm2tgz index ef465c54a2f..552a3a175b5 100644 --- a/completions/rpm2tgz +++ b/completions/rpm2tgz @@ -6,7 +6,7 @@ _comp_cmd_rpm2tgz() _comp_initialize -- "$@" || return if [[ $cur == -* ]]; then - COMPREPLY=($(compgen -W '-s -S -n -r -d -c' -- "$cur")) + _comp_compgen -- -W '-s -S -n -r -d -c' return fi diff --git a/completions/rsync b/completions/rsync index f2f80437331..134ef211f99 100644 --- a/completions/rsync +++ b/completions/rsync @@ -23,12 +23,12 @@ _comp_cmd_rsync() ;; --rsh | -${noargopts}e) compopt +o nospace - COMPREPLY=($(compgen -W 'rsh ssh' -- "$cur")) + _comp_compgen -- -W 'rsh ssh' return ;; --compress-level) compopt +o nospace - COMPREPLY=($(compgen -W '{1..9}' -- "$cur")) + _comp_compgen -- -W '{1..9}' return ;; --info) diff --git a/completions/sbopkg b/completions/sbopkg index 7699002103a..b37f303f71b 100644 --- a/completions/sbopkg +++ b/completions/sbopkg @@ -12,7 +12,7 @@ _comp_cmd_sbopkg() case "$prev" in -e) - COMPREPLY=($(compgen -W 'ask continue stop' -- "$cur")) + _comp_compgen -- -W 'ask continue stop' return ;; -f) diff --git a/completions/screen b/completions/screen index 63e174f4732..ce40dbb7db3 100644 --- a/completions/screen +++ b/completions/screen @@ -7,7 +7,7 @@ _comp_cmd_screen__sessions() ((${#sessions[@]} == 0)) && return if [[ $cur == +([0-9])?(.*) ]]; then # Complete sessions including pid prefixes - COMPREPLY=($(compgen -W '"${sessions[@]}"' -- "$cur")) + _comp_compgen -- -W '"${sessions[@]}"' else # Create unique completions, dropping pids where possible local -A res @@ -18,7 +18,7 @@ _comp_cmd_screen__sessions() for i in "${!res[@]}"; do [[ ${res[i]} == \ *\ * ]] && tmp+=" ${res[i]}" || tmp+=" $i" done - COMPREPLY=($(compgen -W '$tmp' -- "$cur")) + _comp_compgen -- -W '$tmp' fi } && _comp_cmd_screen() @@ -30,11 +30,11 @@ _comp_cmd_screen__sessions() if [[ $cur == /dev* ]]; then _comp_expand_glob COMPREPLY '/dev/serial/*/* /dev/ttyUSB* /dev/ttyACM*' ((${#COMPREPLY[@]})) && - COMPREPLY=($(compgen -W '"${COMPREPLY[@]}"' -- "$cur")) + _comp_compgen -- -W '"${COMPREPLY[@]}"' return fi if [[ $cur == //* ]]; then - COMPREPLY=($(compgen -W '//telnet' -- "$cur")) + _comp_compgen -- -W '//telnet' return fi fi diff --git a/completions/secret-tool b/completions/secret-tool index f8edcfc3c9c..f88df742b96 100644 --- a/completions/secret-tool +++ b/completions/secret-tool @@ -26,14 +26,14 @@ _comp_cmd_secret_tool() fi done)) ((${#modes[@]})) && - COMPREPLY=($(compgen -W '"${modes[@]}"' -- "$cur")) + _comp_compgen -- -W '"${modes[@]}"' return fi case $mode in store) if [[ ${words[*]} != *\ --label[\ =]* ]]; then - COMPREPLY=($(compgen -W "--label=" -- "$cur")) + _comp_compgen -- -W "--label=" [[ ${COMPREPLY-} == *= ]] && compopt -o nospace fi ;; @@ -43,7 +43,7 @@ _comp_cmd_secret_tool() [[ $word ]] && unset -v 'opts[$word]' done ((${#opts[@]})) && - COMPREPLY=($(compgen -W '"${!opts[@]}"' -- "$cur")) + _comp_compgen -- -W '"${!opts[@]}"' ;; esac } && diff --git a/completions/sh b/completions/sh index ec2dcb5c0f5..18e3cf01d2f 100644 --- a/completions/sh +++ b/completions/sh @@ -19,10 +19,10 @@ _comp_cmd_sh() local opts="-a -b -C -e -f -h -i -m -n -o -u -v -x" if [[ $cur == -* ]]; then - COMPREPLY=($(compgen -W "$opts -c -s" -- "$cur")) + _comp_compgen -- -W "$opts -c -s" return elif [[ $cur == +* ]]; then - COMPREPLY=($(compgen -W "${opts//-/+}" -- "$cur")) + _comp_compgen -- -W "${opts//-/+}" return fi diff --git a/completions/sha256sum b/completions/sha256sum index d7e0bf8e754..4f6c917c305 100644 --- a/completions/sha256sum +++ b/completions/sha256sum @@ -31,7 +31,7 @@ _comp_cmd_sha256sum() _comp_compgen_filedir ((${#COMPREPLY[@]})) && - COMPREPLY=($(compgen -X "*.$sumtype" -W '"${COMPREPLY[@]}"' -- "$cur")) + _comp_compgen -- -X "*.$sumtype" -W '"${COMPREPLY[@]}"' } && complete -F _comp_cmd_sha256sum md5sum sha{,1,224,256,384,512}sum diff --git a/completions/shellcheck b/completions/shellcheck index 0c7d0250cf2..cbbe693e548 100644 --- a/completions/shellcheck +++ b/completions/shellcheck @@ -25,7 +25,7 @@ _comp_cmd_shellcheck() local args=$("$1" --format=nonexistent-format /dev/null 2>&1 | command sed -ne '/^Supported formats/,//p' | command sed -ne '/^[[:space:]]/p') - COMPREPLY=($(compgen -W '$args' -- "$cur")) + _comp_compgen -- -W '$args' return ;; --color | -${noargopts}C) @@ -37,7 +37,7 @@ _comp_cmd_shellcheck() return ;; --enable | -${noargopts}o) - COMPREPLY=($(compgen -W 'all' -- "$cur")) # TODO others? + _comp_compgen -- -W 'all' # TODO others? return ;; --source-path | -${noargopts}P) diff --git a/completions/smartctl b/completions/smartctl index db5b756b73b..476c877982e 100644 --- a/completions/smartctl +++ b/completions/smartctl @@ -6,12 +6,12 @@ _comp_cmd_smartctl__device() areca* | 3ware* | megaraid* | cciss*) # shellcheck disable=SC2054 COMPREPLY+=(${cur%%,*},{0..31}) - COMPREPLY=($(compgen -W '"${COMPREPLY[@]}"' -- "$cur")) + _comp_compgen -- -W '"${COMPREPLY[@]}"' ;; hpt*) # shellcheck disable=SC2054 COMPREPLY+=(hpt,{1..4}/{1..8} hpt,{1..4}/{1..8}/{1..5}) - COMPREPLY=($(compgen -W '"${COMPREPLY[@]}"' -- "$cur")) + _comp_compgen -- -W '"${COMPREPLY[@]}"' ;; *) COMPREPLY=($(compgen -W "ata scsi sat usbcypress usbjmicron @@ -53,7 +53,7 @@ _comp_cmd_smartctl() # shellcheck disable=SC2254 case $prev in --quietmode | -${noargopts}q) - COMPREPLY=($(compgen -W 'errorsonly silent noserial' -- "$cur")) + _comp_compgen -- -W 'errorsonly silent noserial' return ;; --device | -${noargopts}d) @@ -68,19 +68,19 @@ _comp_cmd_smartctl() return ;; --badsum | -${noargopts}b) - COMPREPLY=($(compgen -W 'warn exit ignore' -- "$cur")) + _comp_compgen -- -W 'warn exit ignore' return ;; --report | -${noargopts}r) - COMPREPLY=($(compgen -W 'ioctl ataioctl scsiioctl' -- "$cur")) + _comp_compgen -- -W 'ioctl ataioctl scsiioctl' return ;; --nocheck | -${noargopts}n) - COMPREPLY=($(compgen -W 'never sleep standby idle' -- "$cur")) + _comp_compgen -- -W 'never sleep standby idle' return ;; --smart | --offlineauto | --saveauto | -${noargopts}[soS]) - COMPREPLY=($(compgen -W 'on off' -- "$cur")) + _comp_compgen -- -W 'on off' return ;; --log | -${noargopts}l) @@ -105,7 +105,7 @@ _comp_cmd_smartctl() return ;; --presets | -${noargopts}P) - COMPREPLY=($(compgen -W 'use ignore show showall' -- "$cur")) + _comp_compgen -- -W 'use ignore show showall' return ;; --drivedb | -${noargopts}B) diff --git a/completions/smbclient b/completions/smbclient index 8938964f3e8..e3c6b261942 100644 --- a/completions/smbclient +++ b/completions/smbclient @@ -2,7 +2,7 @@ _comp_cmd_smbclient__resolve_order() { - COMPREPLY=($(compgen -W 'lmhosts host wins bcast' -- "$cur")) + _comp_compgen -- -W 'lmhosts host wins bcast' } _comp_cmd_smbclient__domains() @@ -24,7 +24,7 @@ _comp_cmd_smbclient__hosts() _comp_cmd_smbclient__debuglevel() { - COMPREPLY=($(compgen -W '{0..10}' -- "$cur")) + _comp_compgen -- -W '{0..10}' } _comp_cmd_smbclient__sockopts() @@ -36,7 +36,7 @@ _comp_cmd_smbclient__sockopts() _comp_cmd_smbclient__signing() { - COMPREPLY=($(compgen -W 'on off required' -- "$cur")) + _comp_compgen -- -W 'on off required' } _comp_cmd_smbclient() @@ -69,7 +69,7 @@ _comp_cmd_smbclient() return ;; -${noargopts}T) - COMPREPLY=($(compgen -W 'c x I X F b g q r N a' -- "$cur")) + _comp_compgen -- -W 'c x I X F b g q r N a' return ;; --workgroup | -${noargopts}W) diff --git a/completions/sqlite3 b/completions/sqlite3 index f6e69d9609f..ffeced4d05d 100644 --- a/completions/sqlite3 +++ b/completions/sqlite3 @@ -18,7 +18,7 @@ _comp_cmd_sqlite3() ;; -cmd) compopt -o filenames - COMPREPLY=($(compgen -c -- "$cur")) + _comp_compgen -- -c return ;; esac diff --git a/completions/ssh b/completions/ssh index 78e632de21e..08f7d06ec2e 100644 --- a/completions/ssh +++ b/completions/ssh @@ -110,19 +110,19 @@ _comp_cmd_ssh__suboption() pubkeyauthentication | rhostsrsaauthentication | \ rsaauthentication | streamlocalbindunlink | \ tcpkeepalive | useprivilegedport | visualhostkey) - COMPREPLY=($(compgen -W 'yes no' -- "$cur")) + _comp_compgen -- -W 'yes no' ;; addkeystoagent) - COMPREPLY=($(compgen -W 'yes ask confirm no' -- "$cur")) + _comp_compgen -- -W 'yes ask confirm no' ;; addressfamily) - COMPREPLY=($(compgen -W 'any inet inet6' -- "$cur")) + _comp_compgen -- -W 'any inet inet6' ;; bindaddress) _ip_addresses ;; canonicalizehostname) - COMPREPLY=($(compgen -W 'yes no always' -- "$cur")) + _comp_compgen -- -W 'yes no always' ;; identityfile) _comp_xfunc_ssh_identityfile @@ -135,19 +135,19 @@ _comp_cmd_ssh__suboption() COMPREPLY=($(compgen -W '$(_comp_xfunc_ssh_query "$2" sig)' -- "$cur")) ;; cipher) - COMPREPLY=($(compgen -W 'blowfish des 3des' -- "$cur")) + _comp_compgen -- -W 'blowfish des 3des' ;; ciphers) _comp_cmd_ssh__ciphers "$2" ;; controlmaster) - COMPREPLY=($(compgen -W 'yes ask auto autoask no' -- "$cur")) + _comp_compgen -- -W 'yes ask auto autoask no' ;; compressionlevel) - COMPREPLY=($(compgen -W '{1..9}' -- "$cur")) + _comp_compgen -- -W '{1..9}' ;; fingerprinthash) - COMPREPLY=($(compgen -W 'md5 sha256' -- "$cur")) + _comp_compgen -- -W 'md5 sha256' ;; ipqos) COMPREPLY=($(compgen -W 'af1{1..4} af2{2..3} af3{1..3} af4{1..3} @@ -179,33 +179,33 @@ _comp_cmd_ssh__suboption() local protocols=($(_comp_xfunc_ssh_query "$2" protocol-version)) [[ $protocols ]] || protocols=(1 2) if ((${#protocols[@]} > 1)); then - COMPREPLY=($(compgen -W '"${protocols[@]}"' -- "$cur")) + _comp_compgen -- -W '"${protocols[@]}"' fi ;; proxyjump) _known_hosts_real -a ${configfile:+-F "$configfile"} -- "$cur" ;; proxycommand | remotecommand | localcommand) - COMPREPLY=($(compgen -c -- "$cur")) + _comp_compgen -- -c ;; pubkeyacceptedalgorithms | pubkeyacceptedkeytypes) COMPREPLY=($(compgen -W '$(_comp_xfunc_ssh_query "$2" key)' -- "$cur")) ;; requesttty) - COMPREPLY=($(compgen -W 'no yes force auto' -- "$cur")) + _comp_compgen -- -W 'no yes force auto' ;; stricthostkeychecking) - COMPREPLY=($(compgen -W 'accept-new ask no off' -- "$cur")) + _comp_compgen -- -W 'accept-new ask no off' ;; syslogfacility) - COMPREPLY=($(compgen -W 'DAEMON USER AUTH LOCAL{0..7}' -- "$cur")) + _comp_compgen -- -W 'DAEMON USER AUTH LOCAL{0..7}' ;; tunnel) COMPREPLY=($(compgen -W 'yes no point-to-point ethernet' \ -- "$cur")) ;; updatehostkeys | verifyhostkeydns) - COMPREPLY=($(compgen -W 'yes no ask' -- "$cur")) + _comp_compgen -- -W 'yes no ask' ;; esac return 0 @@ -309,7 +309,7 @@ _comp_cmd_ssh() return ;; -*l) - COMPREPLY=($(compgen -u -- "$cur")) + _comp_compgen -- -u return ;; -*m) @@ -317,7 +317,7 @@ _comp_cmd_ssh() return ;; -*O) - COMPREPLY=($(compgen -W 'check forward cancel exit stop' -- "$cur")) + _comp_compgen -- -W 'check forward cancel exit stop' return ;; -*o) @@ -402,7 +402,7 @@ _comp_cmd_sftp() ;; -*S) compopt -o filenames - COMPREPLY=($(compgen -c -- "$cur")) + _comp_compgen -- -c return ;; -*4*) @@ -546,7 +546,7 @@ _comp_cmd_scp() ;; -*S) compopt +o nospace -o filenames - COMPREPLY=($(compgen -c -- "$cur")) + _comp_compgen -- -c return ;; -*4*) diff --git a/completions/ssh-add b/completions/ssh-add index b027b6692a8..53de500f2d0 100644 --- a/completions/ssh-add +++ b/completions/ssh-add @@ -7,7 +7,7 @@ _comp_cmd_ssh_add() case $prev in -*E) - COMPREPLY=($(compgen -W 'md5 sha256' -- "$cur")) + _comp_compgen -- -W 'md5 sha256' return ;; -*t) diff --git a/completions/ssh-keygen b/completions/ssh-keygen index 0f11918d39b..775d3d1331f 100644 --- a/completions/ssh-keygen +++ b/completions/ssh-keygen @@ -23,11 +23,11 @@ _comp_cmd_ssh_keygen() ;; esac ((${#sizes[@]})) && - COMPREPLY=($(compgen -W '"${sizes[@]}"' -- "$cur")) + _comp_compgen -- -W '"${sizes[@]}"' return ;; -*E) - COMPREPLY=($(compgen -W 'md5 sha256' -- "$cur")) + _comp_compgen -- -W 'md5 sha256' return ;; -*[FR]) @@ -44,7 +44,7 @@ _comp_cmd_ssh_keygen() return ;; -*m) - COMPREPLY=($(compgen -W 'PEM PKCS8 RFC4716' -- "$cur")) + _comp_compgen -- -W 'PEM PKCS8 RFC4716' return ;; -*n) @@ -105,7 +105,7 @@ _comp_cmd_ssh_keygen() if [[ $protocols == *1* ]]; then types+=' rsa1' fi - COMPREPLY=($(compgen -W "$types" -- "$cur")) + _comp_compgen -- -W "$types" return ;; -*Y) @@ -119,7 +119,7 @@ _comp_cmd_ssh_keygen() if [[ $cur == -* ]]; then local opts=$(_parse_usage "$1" "-?") [[ ! $opts ]] && opts=$(_parse_help "$1" "-?") # OpenSSH < 7 - COMPREPLY=($(compgen -W "$opts" -- "$cur")) + _comp_compgen -- -W "$opts" fi if [[ ${words[*]} == *\ -*s\ * ]]; then diff --git a/completions/strace b/completions/strace index 3323e394d2d..4a41e3e2fbb 100644 --- a/completions/strace +++ b/completions/strace @@ -78,7 +78,7 @@ _comp_cmd_strace() return ;; -*S) - COMPREPLY=($(compgen -W 'time calls name nothing' -- "$cur")) + _comp_compgen -- -W 'time calls name nothing' return ;; -*u) @@ -90,7 +90,7 @@ _comp_cmd_strace() if [[ $cur == -* ]]; then COMPREPLY=($(compgen -W '$(_parse_help "$1" -h)' -- "$cur")) else - COMPREPLY=($(compgen -c -- "$cur")) + _comp_compgen -- -c fi fi } && diff --git a/completions/strings b/completions/strings index 3b1a52d654f..a703729f915 100644 --- a/completions/strings +++ b/completions/strings @@ -13,7 +13,7 @@ _comp_cmd_strings() return ;; --radix | -${noargopts}t) - COMPREPLY=($(compgen -W 'o d x' -- "$cur")) + _comp_compgen -- -W 'o d x' return ;; --target | -${noargopts}T) diff --git a/completions/sudo b/completions/sudo index 542770a8834..75aaef79ab5 100644 --- a/completions/sudo +++ b/completions/sudo @@ -30,11 +30,11 @@ _comp_cmd_sudo() # shellcheck disable=SC2254 case "$prev" in --user | --other-user | -${noargopts}[uU]) - COMPREPLY=($(compgen -u -- "$cur")) + _comp_compgen -- -u return ;; --group | -${noargopts}g) - COMPREPLY=($(compgen -g -- "$cur")) + _comp_compgen -- -g return ;; --close-from | --prompt | -${noargopts}[Cp]) diff --git a/completions/svcadm b/completions/svcadm index c4d08313ca4..4fa3e7d4cd5 100644 --- a/completions/svcadm +++ b/completions/svcadm @@ -113,29 +113,29 @@ _comp_cmd_svcadm() if [[ ! $command ]]; then if [[ ${cur} == -* ]]; then - COMPREPLY=($(compgen -W "-v" -- "${cur}")) + _comp_compgen -- -W "-v" else - COMPREPLY=($(compgen -W "$command_list" -- "${cur}")) + _comp_compgen -- -W "$command_list" fi else if [[ ${cur} == -* ]]; then case "$command" in enable) - COMPREPLY=($(compgen -W "-r -s -t" -- "${cur}")) + _comp_compgen -- -W "-r -s -t" ;; disable) - COMPREPLY=($(compgen -W "-s -t" -- "${cur}")) + _comp_compgen -- -W "-s -t" ;; mark) - COMPREPLY=($(compgen -W "-I -t" -- "${cur}")) + _comp_compgen -- -W "-I -t" ;; milestone) - COMPREPLY=($(compgen -W "-d" -- "${cur}")) + _comp_compgen -- -W "-d" ;; esac else if [[ $command == "mark" && $prev != @(degraded|maintenance) ]]; then - COMPREPLY=($(compgen -W "degraded maintenance" -- "${cur}")) + _comp_compgen -- -W "degraded maintenance" elif [[ $command == "milestone" ]]; then _comp_cmd_svcadm__fmri "${cur}" "svc:/milestone" else diff --git a/completions/svk b/completions/svk index 140d6de3562..65a2052302a 100644 --- a/completions/svk +++ b/completions/svk @@ -16,9 +16,9 @@ _comp_cmd_svk() if ((cword == 1)); then if [[ $cur == -* ]]; then - COMPREPLY=($(compgen -W '--version' -- "$cur")) + _comp_compgen -- -W '--version' else - COMPREPLY=($(compgen -W "$commands" -- "$cur")) + _comp_compgen -- -W "$commands" fi else case $prev in @@ -172,7 +172,7 @@ _comp_cmd_svk() esac options+=" --help -h" - COMPREPLY=($(compgen -W "$options" -- "$cur")) + _comp_compgen -- -W "$options" else case $command in help | h | \?) diff --git a/completions/sync_members b/completions/sync_members index 048d9266dea..29fd7a976b3 100644 --- a/completions/sync_members +++ b/completions/sync_members @@ -7,7 +7,7 @@ _comp_cmd_sync_members() case $prev in -w | -g | -d | --welcome-msg | --goodbye-msg | --digest) - COMPREPLY=($(compgen -W 'y n' -- "$cur")) + _comp_compgen -- -W 'y n' return ;; --file) diff --git a/completions/sysbench b/completions/sysbench index 7611a2097e4..61ba548e932 100644 --- a/completions/sysbench +++ b/completions/sysbench @@ -11,7 +11,7 @@ _comp_cmd_sysbench() return ;; --init-rng | --debug | --validate) - COMPREPLY=($(compgen -W 'on off' -- "$cur")) + _comp_compgen -- -W 'on off' return ;; --test) @@ -28,43 +28,43 @@ _comp_cmd_sysbench() return ;; --file-io-mode) - COMPREPLY=($(compgen -W 'sync async fastmmap slowmmap' -- "$cur")) + _comp_compgen -- -W 'sync async fastmmap slowmmap' return ;; --file-extra-flags) - COMPREPLY=($(compgen -W 'sync dsync direct' -- "$cur")) + _comp_compgen -- -W 'sync dsync direct' return ;; --file-fsync-all | --file-fsync-end) - COMPREPLY=($(compgen -W 'on off' -- "$cur")) + _comp_compgen -- -W 'on off' return ;; --file-fsync-mode) - COMPREPLY=($(compgen -W 'fsync fdatasync' -- "$cur")) + _comp_compgen -- -W 'fsync fdatasync' return ;; --memory-scope) - COMPREPLY=($(compgen -W 'global local' -- "$cur")) + _comp_compgen -- -W 'global local' return ;; --memory-hugetlb) - COMPREPLY=($(compgen -W 'on off' -- "$cur")) + _comp_compgen -- -W 'on off' return ;; --memory-oper) - COMPREPLY=($(compgen -W 'read write none' -- "$cur")) + _comp_compgen -- -W 'read write none' return ;; --memory-access-mode) - COMPREPLY=($(compgen -W 'seq rnd' -- "$cur")) + _comp_compgen -- -W 'seq rnd' return ;; --oltp-test-mode) - COMPREPLY=($(compgen -W 'simple complex nontrx sp' -- "$cur")) + _comp_compgen -- -W 'simple complex nontrx sp' return ;; --oltp-read-only | --oltp-skip-trx | --oltp-quto-inc | --mysql-ssl) - COMPREPLY=($(compgen -W 'on off' -- "$cur")) + _comp_compgen -- -W 'on off' return ;; --oltp-nontrx-mode) @@ -73,7 +73,7 @@ _comp_cmd_sysbench() return ;; --oltp-dist-type) - COMPREPLY=($(compgen -W 'uniform gaussian special' -- "$cur")) + _comp_compgen -- -W 'uniform gaussian special' return ;; --db-driver) @@ -83,7 +83,7 @@ _comp_cmd_sysbench() return ;; --db-ps-mode) - COMPREPLY=($(compgen -W 'auto disable' -- "$cur")) + _comp_compgen -- -W 'auto disable' return ;; --mysql-socket) @@ -96,7 +96,7 @@ _comp_cmd_sysbench() return ;; --mysql-engine-trx) - COMPREPLY=($(compgen -W 'yes no auto' -- "$cur")) + _comp_compgen -- -W 'yes no auto' return ;; --*) @@ -122,10 +122,10 @@ _comp_cmd_sysbench() fi if [[ $cur == -* || ! $has_test ]]; then - COMPREPLY=($(compgen -W "$opts" -- "$cur")) + _comp_compgen -- -W "$opts" [[ ${COMPREPLY-} == *= ]] && compopt -o nospace else - COMPREPLY=($(compgen -W "prepare run cleanup help version" -- "$cur")) + _comp_compgen -- -W "prepare run cleanup help version" fi } && complete -F _comp_cmd_sysbench sysbench diff --git a/completions/tar b/completions/tar index c93433fdda1..9bcc43d4f76 100644 --- a/completions/tar +++ b/completions/tar @@ -339,7 +339,7 @@ _comp_cmd_tar__mode() _comp_cmd_tar__gnu_long_options() { local rv - COMPREPLY=($(compgen -W "$long_opts" -- "$cur")) + _comp_compgen -- -W "$long_opts" rv=$? [[ ${COMPREPLY-} == *= ]] && compopt -o nospace return $rv @@ -357,7 +357,7 @@ _comp_cmd_tar__gnu_short_options() generated+=" $cur$c" done - COMPREPLY=($(compgen -W "$generated" -- "$cur")) + _comp_compgen -- -W "$generated" } # TODO: rename per API conventions @@ -555,30 +555,30 @@ _comp_cmd_tar__gnu() break ;; --hole-detection) - COMPREPLY=($(compgen -W 'raw seek' -- "$cur")) + _comp_compgen -- -W 'raw seek' break ;; --to-command | --info-script | --new-volume-script | \ --rmt-command | --rsh-command | --use-compress-program | \ -${noargopts}[FI]) compopt -o filenames - COMPREPLY=($(compgen -c -- "$cur")) + _comp_compgen -- -c break ;; --atime-preserve) - COMPREPLY=($(compgen -W 'replace system' -- "$cur")) + _comp_compgen -- -W 'replace system' break ;; --group) - COMPREPLY=($(compgen -g -- "$cur")) + _comp_compgen -- -g break ;; --owner) - COMPREPLY=($(compgen -u -- "$cur")) + _comp_compgen -- -u break ;; --sort) - COMPREPLY=($(compgen -W 'none name inode' -- "$cur")) + _comp_compgen -- -W 'none name inode' break ;; --file | -${noargopts}f) diff --git a/completions/tcpdump b/completions/tcpdump index 04c2f7ab2c6..771f8391424 100644 --- a/completions/tcpdump +++ b/completions/tcpdump @@ -28,7 +28,7 @@ _comp_cmd_tcpdump() ;; -${noargopts}z) compopt -o filenames - COMPREPLY=($(compgen -c -- "$cur")) + _comp_compgen -- -c return ;; --relinquish-privileges | -${noargopts}Z) @@ -44,11 +44,11 @@ _comp_cmd_tcpdump() return ;; --direction | -${noargopts}Q) - COMPREPLY=($(compgen -W 'in out inout' -- "$cur")) + _comp_compgen -- -W 'in out inout' return ;; --time-stamp-precision) - COMPREPLY=($(compgen -W 'micro nano' -- "$cur")) + _comp_compgen -- -W 'micro nano' return ;; esac diff --git a/completions/tcpkill b/completions/tcpkill index bbe88aab57a..5b66cf6b14f 100644 --- a/completions/tcpkill +++ b/completions/tcpkill @@ -13,7 +13,7 @@ _comp_cmd_tcpkill() esac if [[ $cur == -* ]]; then - COMPREPLY=($(compgen -W '-i -1 -2 -3 -4 -5 -6 -7 -8 -9' -- "$cur")) + _comp_compgen -- -W '-i -1 -2 -3 -4 -5 -6 -7 -8 -9' fi } && diff --git a/completions/tipc b/completions/tipc index 03fd9d5cf68..5cd831d93b0 100644 --- a/completions/tipc +++ b/completions/tipc @@ -5,10 +5,10 @@ _comp_cmd_tipc__media() local optind=$1 if ((cword == optind)); then - COMPREPLY=($(compgen -W 'media' -- "$cur")) + _comp_compgen -- -W 'media' return 0 elif ((cword == optind + 1)); then - COMPREPLY=($(compgen -W 'udp eth ib' -- "$cur")) + _comp_compgen -- -W 'udp eth ib' return 0 fi @@ -33,10 +33,10 @@ _comp_cmd_tipc__bearer() if ((cword == optind + 2)); then case "$media" in "udp") - COMPREPLY=($(compgen -W 'name' -- "$cur")) + _comp_compgen -- -W 'name' ;; "eth" | "ib") - COMPREPLY=($(compgen -W 'device' -- "$cur")) + _comp_compgen -- -W 'device' ;; esac elif ((cword == optind + 3)); then @@ -45,11 +45,11 @@ _comp_cmd_tipc__bearer() local names=$( tipc bearer list 2>/dev/null | awk -F: '/^udp:/ {print $2}' ) - COMPREPLY=($(compgen -W '$names' -- "$cur")) + _comp_compgen -- -W '$names' ;; "eth") local interfaces=$(command ls /sys/class/net/) - COMPREPLY=($(compgen -W '$interfaces' -- "$cur")) + _comp_compgen -- -W '$interfaces' ;; esac fi @@ -57,7 +57,7 @@ _comp_cmd_tipc__bearer() _comp_cmd_tipc__link_opts() { - COMPREPLY=($(compgen -W 'priority tolerance window' -- "$cur")) + _comp_compgen -- -W 'priority tolerance window' } _comp_cmd_tipc__link() @@ -66,14 +66,14 @@ _comp_cmd_tipc__link() local filter=$2 if ((cword == optind)); then - COMPREPLY=($(compgen -W 'link' -- "$cur")) + _comp_compgen -- -W 'link' elif ((cword == optind + 1)); then # awk drops link state and last trailing : local links=$(tipc link list 2>/dev/null | awk '{print substr($1, 0, length($1))}') local -a exclude [[ $filter == peers ]] && exclude=(-X broadcast-link) - COMPREPLY=($(compgen "${exclude[@]}" -W '$links' -- "$cur")) + _comp_compgen -- "${exclude[@]}" -W '$links' fi } @@ -88,7 +88,7 @@ _comp_cmd_tipc() # Flags can be placed anywhere in the commandline case "$cur" in -*) - COMPREPLY=($(compgen -W '-h --help' -- "$cur")) + _comp_compgen -- -W '-h --help' return ;; esac @@ -157,7 +157,7 @@ _comp_cmd_tipc() done done - COMPREPLY=($(compgen -W '"${params[@]}"' -- "$cur")) + _comp_compgen -- -W '"${params[@]}"' ;; disable) ((optind++)) @@ -188,7 +188,7 @@ _comp_cmd_tipc() ((optind++)) if ((cword == optind)); then - COMPREPLY=($(compgen -W 'get set list statistics' -- "$cur")) + _comp_compgen -- -W 'get set list statistics' return fi @@ -215,7 +215,7 @@ _comp_cmd_tipc() ((optind++)) if ((cword == optind)); then - COMPREPLY=($(compgen -W 'show reset' -- "$cur")) + _comp_compgen -- -W 'show reset' return fi @@ -231,7 +231,7 @@ _comp_cmd_tipc() ((optind++)) if ((cword == optind)); then - COMPREPLY=($(compgen -W 'get set list' -- "$cur")) + _comp_compgen -- -W 'get set list' return fi @@ -260,14 +260,14 @@ _comp_cmd_tipc() ((optind++)) if ((cword == optind)); then - COMPREPLY=($(compgen -W 'show' -- "$cur")) + _comp_compgen -- -W 'show' fi ;; node) ((optind++)) if ((cword == optind)); then - COMPREPLY=($(compgen -W 'list get set' -- "$cur")) + _comp_compgen -- -W 'list get set' return fi @@ -276,7 +276,7 @@ _comp_cmd_tipc() ((optind++)) if ((cword == optind)); then - COMPREPLY=($(compgen -W 'address netid' -- "$cur")) + _comp_compgen -- -W 'address netid' fi ;; esac @@ -285,7 +285,7 @@ _comp_cmd_tipc() ((optind++)) if ((cword == optind)); then - COMPREPLY=($(compgen -W 'list' -- "$cur")) + _comp_compgen -- -W 'list' fi ;; esac diff --git a/completions/tree b/completions/tree index 4b7a6ddc914..96a15f7965f 100644 --- a/completions/tree +++ b/completions/tree @@ -20,7 +20,7 @@ _comp_cmd_tree() return ;; --sort) - COMPREPLY=($(compgen -W "name version size mtime ctime" -- "$cur")) + _comp_compgen -- -W "name version size mtime ctime" return ;; esac diff --git a/completions/tshark b/completions/tshark index 8a6d0753f34..1954108f45f 100644 --- a/completions/tshark +++ b/completions/tshark @@ -54,7 +54,7 @@ _comp_cmd_tshark() return ;; -*[ab]) - COMPREPLY=($(compgen -W 'duration: filesize: files:' -- "$cur")) + _comp_compgen -- -W 'duration: filesize: files:' [[ ${COMPREPLY-} == *: ]] && compopt -o nospace return ;; @@ -94,11 +94,11 @@ _comp_cmd_tshark() ;; -*u) # TODO: could be parsed from "-u ." output - COMPREPLY=($(compgen -W 's hms' -- "$cur")) + _comp_compgen -- -W 's hms' return ;; -*W) - COMPREPLY=($(compgen -W 'n' -- "$cur")) + _comp_compgen -- -W 'n' return ;; -*X) diff --git a/completions/tsig-keygen b/completions/tsig-keygen index fb9887e249f..3a28f1b4fde 100644 --- a/completions/tsig-keygen +++ b/completions/tsig-keygen @@ -16,7 +16,7 @@ _comp_cmd_tsig_keygen() return ;; -r) - COMPREPLY=($(compgen -W keyboard -- "$cur")) + _comp_compgen -- -W keyboard _comp_compgen -a filedir return ;; diff --git a/completions/tune2fs b/completions/tune2fs index 2b5dc78d6be..5bb02ff4e66 100644 --- a/completions/tune2fs +++ b/completions/tune2fs @@ -10,13 +10,13 @@ _comp_cmd_tune2fs() return ;; -*e) - COMPREPLY=($(compgen -W 'continue remount-ro panic' -- "$cur")) + _comp_compgen -- -W 'continue remount-ro panic' return ;; -*g) _gids ((${#COMPREPLY[@]})) && - COMPREPLY=($(compgen -g -W '"${COMPREPLY[@]}"' -- "$cur")) + _comp_compgen -- -g -W '"${COMPREPLY[@]}"' return ;; -*M) @@ -27,7 +27,7 @@ _comp_cmd_tune2fs() local -a opts=(^debug ^bsdgroups ^user_xattr ^acl ^uid16 ^journal_data ^journal_data_ordered ^journal_data_writeback ^nobarrier ^block_validity ^discard ^nodelalloc) - COMPREPLY=($(compgen -W '"${opts[@]}" "${opts[@]#^}"' -- "$cur")) + _comp_compgen -- -W '"${opts[@]}" "${opts[@]#^}"' return ;; -*O) @@ -35,17 +35,17 @@ _comp_cmd_tune2fs() ^filetype ^flex_bg ^has_journal ^huge_file ^large_file ^metadata_csum ^mmp ^project ^quota ^read-only ^resize_inode ^sparse_super ^uninit_bg) - COMPREPLY=($(compgen -W '"${opts[@]}" "${opts[@]#^}"' -- "$cur")) + _comp_compgen -- -W '"${opts[@]}" "${opts[@]#^}"' return ;; -*u) _uids ((${#COMPREPLY[@]})) && - COMPREPLY=($(compgen -u -W '"${COMPREPLY[@]}"' -- "$cur")) + _comp_compgen -- -u -W '"${COMPREPLY[@]}"' return ;; -*U) - COMPREPLY=($(compgen -W 'clear random time' -- "$cur")) + _comp_compgen -- -W 'clear random time' return ;; esac diff --git a/completions/ulimit b/completions/ulimit index 107c9554eb5..c91b0bbc2c3 100644 --- a/completions/ulimit +++ b/completions/ulimit @@ -10,7 +10,7 @@ _comp_cmd_ulimit() local mode= case $prev in -a) - COMPREPLY=($(compgen -W "-S -H" -- "$cur")) + _comp_compgen -- -W "-S -H" return ;; -[SH]) ;; @@ -32,7 +32,7 @@ _comp_cmd_ulimit() fi fi - [[ ${mode-} ]] && COMPREPLY=($(compgen -W "soft hard unlimited" -- "$cur")) + [[ ${mode-} ]] && _comp_compgen -- -W "soft hard unlimited" } && complete -F _comp_cmd_ulimit ulimit diff --git a/completions/unace b/completions/unace index c30232931d4..da647b810ec 100644 --- a/completions/unace +++ b/completions/unace @@ -6,10 +6,10 @@ _comp_cmd_unace() _comp_initialize -- "$@" || return if [[ $cur == -* ]]; then - COMPREPLY=($(compgen -W '-c -c- -f -f- -o -o- -p -y -y-' -- "$cur")) + _comp_compgen -- -W '-c -c- -f -f- -o -o- -p -y -y-' else if ((cword == 1)); then - COMPREPLY=($(compgen -W 'e l t v x' -- "$cur")) + _comp_compgen -- -W 'e l t v x' else _comp_compgen_filedir '@(ace|cba)' fi diff --git a/completions/unpack200 b/completions/unpack200 index 46f30f3230d..686380ce802 100644 --- a/completions/unpack200 +++ b/completions/unpack200 @@ -12,11 +12,11 @@ _comp_cmd_unpack200() return ;; --deflate-hint | -${noargopts}H) - COMPREPLY=($(compgen -W 'true false keep' -- "$cur")) + _comp_compgen -- -W 'true false keep' return ;; --log-file | -${noargopts}l) - COMPREPLY=($(compgen -W '-' -- "$cur")) + _comp_compgen -- -W '-' _comp_compgen -a filedir log return ;; diff --git a/completions/unrar b/completions/unrar index da64f2597d0..a03cdf9c96a 100644 --- a/completions/unrar +++ b/completions/unrar @@ -11,7 +11,7 @@ _comp_cmd_unrar() -ver -vp -x -x@ -y' -- "$cur")) else if ((cword == 1)); then - COMPREPLY=($(compgen -W 'e l lb lt p t v vb vt x' -- "$cur")) + _comp_compgen -- -W 'e l lb lt p t v vb vt x' else _comp_compgen_filedir '@(rar|exe|cbr)' fi diff --git a/completions/update-alternatives b/completions/update-alternatives index 06352b8aeaa..c2c196845a9 100644 --- a/completions/update-alternatives +++ b/completions/update-alternatives @@ -60,7 +60,7 @@ _comp_cmd_update_alternatives() _comp_compgen_filedir ;; 1) - COMPREPLY=($(compgen -W '--slave' -- "$cur")) + _comp_compgen -- -W '--slave' ;; 3) _comp_cmd_update_alternatives__installed diff --git a/completions/update-rc.d b/completions/update-rc.d index 457436c1eb7..fa0aa64bb89 100644 --- a/completions/update-rc.d +++ b/completions/update-rc.d @@ -20,7 +20,7 @@ _comp_cmd_update_rc_d() COMPREPLY=($(compgen -W '"${options[@]}" ${services[@]+"${services[@]}"}' \ -X '$(tr " " "|" <<<${words[@]})' -- "$cur")) elif ((${#services[@]})) && [[ $prev == ?($(tr " " "|" <<<"${services[*]}")) ]]; then - COMPREPLY=($(compgen -W 'remove defaults start stop' -- "$cur")) + _comp_compgen -- -W 'remove defaults start stop' elif [[ $prev == defaults && $cur == [0-9] ]]; then COMPREPLY=(0 1 2 3 4 5 6 7 8 9) elif [[ $prev == defaults && $cur == [sk]?([0-9]) ]]; then @@ -48,7 +48,7 @@ _comp_cmd_update_rc_d() COMPREPLY=() fi elif [[ $prev == "." ]]; then - COMPREPLY=($(compgen -W "start stop" -- "$cur")) + _comp_compgen -- -W "start stop" else COMPREPLY=() fi diff --git a/completions/useradd b/completions/useradd index a88019c2591..94889484e11 100644 --- a/completions/useradd +++ b/completions/useradd @@ -32,7 +32,7 @@ _comp_cmd_useradd() _gids COMPREPLY+=($(compgen -g)) ((${#COMPREPLY[@]})) && - COMPREPLY=($(compgen -W '"${COMPREPLY[@]}"' -- "$cur")) + _comp_compgen -- -W '"${COMPREPLY[@]}"' return ;; --groups | -${noargopts}G) diff --git a/completions/userdel b/completions/userdel index cc08bce8b81..f359d61a92a 100644 --- a/completions/userdel +++ b/completions/userdel @@ -22,7 +22,7 @@ _comp_cmd_userdel() return fi - COMPREPLY=($(compgen -u -- "$cur")) + _comp_compgen -- -u } && complete -F _comp_cmd_userdel userdel diff --git a/completions/usermod b/completions/usermod index e1a4238b70d..d485d22d592 100644 --- a/completions/usermod +++ b/completions/usermod @@ -28,7 +28,7 @@ _comp_cmd_usermod() _gids COMPREPLY+=($(compgen -g)) ((${#COMPREPLY[@]})) && - COMPREPLY=($(compgen -W '"${COMPREPLY[@]}"' -- "$cur")) + _comp_compgen -- -W '"${COMPREPLY[@]}"' return ;; --groups | -${noargopts}G) @@ -57,7 +57,7 @@ _comp_cmd_usermod() return fi - COMPREPLY=($(compgen -u -- "$cur")) + _comp_compgen -- -u } && complete -F _comp_cmd_usermod usermod diff --git a/completions/valgrind b/completions/valgrind index 5c5c224ffcd..93a84f056e0 100644 --- a/completions/valgrind +++ b/completions/valgrind @@ -39,16 +39,16 @@ _comp_cmd_valgrind() return ;; --sim-hints) - COMPREPLY=($(compgen -W 'lax-ioctls enable-outer' -- "$cur")) + _comp_compgen -- -W 'lax-ioctls enable-outer' return ;; --soname-synonyms) - COMPREPLY=($(compgen -W 'somalloc' -S = -- "$cur")) + _comp_compgen -- -W 'somalloc' -S = [[ ${COMPREPLY-} == *= ]] && compopt -o nospace return ;; --kernel-variant) - COMPREPLY=($(compgen -W 'bproc' -- "$cur")) + _comp_compgen -- -W 'bproc' return ;; # callgrind: @@ -64,7 +64,7 @@ _comp_cmd_valgrind() ;; # massif: --time-unit) - COMPREPLY=($(compgen -W 'i ms B' -- "$cur")) + _comp_compgen -- -W 'i ms B' return ;; # generic cases parsed from --help output @@ -80,7 +80,7 @@ _comp_cmd_valgrind() ;; \) compopt -o filenames - COMPREPLY=($(compgen -c -- "$cur")) + _comp_compgen -- -c return ;; \<+([0-9])..+([0-9])\>) diff --git a/completions/vmstat b/completions/vmstat index 77e424017f2..b144505fbb8 100644 --- a/completions/vmstat +++ b/completions/vmstat @@ -13,7 +13,7 @@ _comp_cmd_vmstat() ;; --unit | -${noargopts}S) [[ $OSTYPE == *linux* ]] && - COMPREPLY=($(compgen -W 'k K m M' -- "$cur")) + _comp_compgen -- -W 'k K m M' return ;; esac diff --git a/completions/vncviewer b/completions/vncviewer index 0a9965aaf52..6d74a03170d 100644 --- a/completions/vncviewer +++ b/completions/vncviewer @@ -65,7 +65,7 @@ _comp_cmd_xvnc4viewer() return ;; -preferredencoding) - COMPREPLY=($(compgen -W 'zrle hextile raw' -- "$cur")) + _comp_compgen -- -W 'zrle hextile raw' return ;; -via) diff --git a/completions/vpnc b/completions/vpnc index d615bbc7d6b..8deebdb208f 100644 --- a/completions/vpnc +++ b/completions/vpnc @@ -17,7 +17,7 @@ _vpnc() return ;; --vendor) - COMPREPLY=($(compgen -W 'cisco netscreen' -- "$cur")) + _comp_compgen -- -W 'cisco netscreen' return ;; --natt-mode) @@ -30,23 +30,23 @@ _vpnc() return ;; --dh) - COMPREPLY=($(compgen -W 'dh1 dh2 dh5' -- "$cur")) + _comp_compgen -- -W 'dh1 dh2 dh5' return ;; --pfs) - COMPREPLY=($(compgen -W 'nopfs dh1 dh2 dh5 server' -- "$cur")) + _comp_compgen -- -W 'nopfs dh1 dh2 dh5 server' return ;; --ifmode) - COMPREPLY=($(compgen -W 'tun tap' -- "$cur")) + _comp_compgen -- -W 'tun tap' return ;; --debug) - COMPREPLY=($(compgen -W '0 1 2 3 99' -- "$cur")) + _comp_compgen -- -W '0 1 2 3 99' return ;; --auth-mode) - COMPREPLY=($(compgen -W 'psk cert hybrid' -- "$cur")) + _comp_compgen -- -W 'psk cert hybrid' return ;; --ca-dir) @@ -55,7 +55,7 @@ _vpnc() ;; --password-helper) compopt -o filenames - COMPREPLY=($(compgen -c -- "$cur")) + _comp_compgen -- -c return ;; esac @@ -74,7 +74,7 @@ _vpnc() configs=("${configs[@]%.conf}") local IFS=$'\n' compopt -o filenames - COMPREPLY=($(compgen -W '"${configs[@]}"' -- "$cur")) + _comp_compgen -- -W '"${configs[@]}"' fi fi } && diff --git a/completions/watch b/completions/watch index f46fa093bb3..6851f3adae2 100644 --- a/completions/watch +++ b/completions/watch @@ -36,7 +36,7 @@ _comp_cmd_watch() case $prev in --differences | -${noargopts}d) [[ $cur != -* ]] && - COMPREPLY=($(compgen -W 'cumulative' -- "$cur")) + _comp_compgen -- -W 'cumulative' return ;; --interval | -${noargopts}n) diff --git a/completions/wget b/completions/wget index a6688ee13f6..5dc7b7d63d5 100644 --- a/completions/wget +++ b/completions/wget @@ -12,7 +12,7 @@ _comp_cmd_wget() return ;; --progress) - COMPREPLY=($(compgen -W 'bar dot' -- "$cur")) + _comp_compgen -- -W 'bar dot' return ;; --bind-address) @@ -59,7 +59,7 @@ _comp_cmd_wget() return ;; --prefer-family) - COMPREPLY=($(compgen -W 'IPv4 IPv6 none' -- "$cur")) + _comp_compgen -- -W 'IPv4 IPv6 none' return ;; --directory-prefix | --ca-directory | --warc-tempdir | -${noargopts}P) @@ -78,11 +78,11 @@ _comp_cmd_wget() return ;; --secure-protocol) - COMPREPLY=($(compgen -W 'auto SSLv2 SSLv3 TLSv1' -- "$cur")) + _comp_compgen -- -W 'auto SSLv2 SSLv3 TLSv1' return ;; --certificate-type | --private-key-type) - COMPREPLY=($(compgen -W 'PEM DER' -- "$cur")) + _comp_compgen -- -W 'PEM DER' return ;; --follow-tags | --ignore-tags) @@ -149,11 +149,11 @@ _comp_cmd_wget() return # TODO base=STR ;; --report-speed) - COMPREPLY=($(compgen -W 'bits' -- "$cur")) + _comp_compgen -- -W 'bits' return ;; --regex-type) - COMPREPLY=($(compgen -W 'posix' -- "$cur")) + _comp_compgen -- -W 'posix' return ;; --base | --password | --ftp-password | --http-password | \ diff --git a/completions/wine b/completions/wine index d0d563f4b44..239f44b5b83 100644 --- a/completions/wine +++ b/completions/wine @@ -13,7 +13,7 @@ _comp_cmd_wine() if ((cword == 1)); then if [[ $cur == -* ]]; then - COMPREPLY=($(compgen -W '--help --version' -- "$cur")) + _comp_compgen -- -W '--help --version' [[ ${COMPREPLY-} ]] && return fi _comp_compgen_filedir '@([eE][xX][eE]?(.[sS][oO])|[cC][oO][mM]|[sS][cC][rR]|[mM][sS][iI])' diff --git a/completions/wodim b/completions/wodim index 210eb6a9f02..6c4575ea066 100644 --- a/completions/wodim +++ b/completions/wodim @@ -25,7 +25,7 @@ _comp_cmd_wodim() cur=${cur#*=} case $prev in varirec) - COMPREPLY=($(compgen -W "-2 -1 0 1 2" -- "$cur")) + _comp_compgen -- -W "-2 -1 0 1 2" ;; gigarec) COMPREPLY=($(compgen -W "0.6 0.7 0.8 1.0 1.2 1.3 @@ -48,7 +48,7 @@ _comp_cmd_wodim() awk 'NR > 1 { print $1 }') help" -- "$cur")) ;; minbuf) - COMPREPLY=($(compgen -W '{25..95}' -- "$cur")) + _comp_compgen -- -W '{25..95}' ;; esac return diff --git a/completions/wsimport b/completions/wsimport index 22050d84d6b..ecc667f0f47 100644 --- a/completions/wsimport +++ b/completions/wsimport @@ -22,7 +22,7 @@ _comp_cmd_wsimport() return ;; -target) - COMPREPLY=($(compgen -W '2.0 2.1 2.2' -- "$cur")) + _comp_compgen -- -W '2.0 2.1 2.2' return ;; -clientjar) diff --git a/completions/xdg-mime b/completions/xdg-mime index 69c27fd629d..8b6c53b14e0 100644 --- a/completions/xdg-mime +++ b/completions/xdg-mime @@ -33,7 +33,7 @@ _comp_cmd_xdg_mime() if ((args == 1)); then if [[ $cur == -* ]]; then - COMPREPLY=($(compgen -W '--help --manual --version' -- "$cur")) + _comp_compgen -- -W '--help --manual --version' return fi COMPREPLY=($(compgen -W \ @@ -44,7 +44,7 @@ _comp_cmd_xdg_mime() case ${words[1]} in query) if ((args == 2)); then - COMPREPLY=($(compgen -W 'filetype default' -- "$cur")) + _comp_compgen -- -W 'filetype default' return fi ((args == 3)) || return @@ -60,7 +60,7 @@ _comp_cmd_xdg_mime() if ((${#desktops[@]})); then desktops=("${desktops[@]##*/}") local IFS=$'\n' - COMPREPLY=($(compgen -W '"${desktops[@]}"' -- "$cur")) + _comp_compgen -- -W '"${desktops[@]}"' fi else _comp_cmd_xdg_mime__mimetype @@ -68,18 +68,18 @@ _comp_cmd_xdg_mime() ;; install) if [[ $cur == -* ]]; then - COMPREPLY=($(compgen -W '--mode --novendor' -- "$cur")) + _comp_compgen -- -W '--mode --novendor' elif [[ $prev == --mode ]]; then - COMPREPLY=($(compgen -W 'user system' -- "$cur")) + _comp_compgen -- -W 'user system' else _comp_compgen_filedir xml fi ;; uninstall) if [[ $cur == -* ]]; then - COMPREPLY=($(compgen -W '--mode' -- "$cur")) + _comp_compgen -- -W '--mode' elif [[ $prev == --mode ]]; then - COMPREPLY=($(compgen -W 'user system' -- "$cur")) + _comp_compgen -- -W 'user system' else _comp_compgen_filedir xml fi diff --git a/completions/xdg-settings b/completions/xdg-settings index f946697de75..3f0eef08f40 100644 --- a/completions/xdg-settings +++ b/completions/xdg-settings @@ -20,7 +20,7 @@ _comp_cmd_xdg_settings() local args _count_args if ((args == 1)); then - COMPREPLY=($(compgen -W "get check set" -- "$cur")) + _comp_compgen -- -W "get check set" elif ((args == 2)); then COMPREPLY=($(compgen -W \ '$("$1" --list | awk "!/^Known/ { print \$1 }")' -- "$cur")) diff --git a/completions/xev b/completions/xev index 9e6848f48fd..5078d27b0fc 100644 --- a/completions/xev +++ b/completions/xev @@ -10,7 +10,7 @@ _comp_cmd_xev() return ;; -bs) - COMPREPLY=($(compgen -W 'NotUseful WhenMapped Always' -- "$cur")) + _comp_compgen -- -W 'NotUseful WhenMapped Always' return ;; -event) diff --git a/completions/xfreerdp b/completions/xfreerdp index 2b4d1415df6..a237dae9712 100644 --- a/completions/xfreerdp +++ b/completions/xfreerdp @@ -12,15 +12,15 @@ _comp_cmd_xfreerdp() return ;; -a) - COMPREPLY=($(compgen -W '8 15 16 24 32' -- "$cur")) + _comp_compgen -- -W '8 15 16 24 32' return ;; -x) - COMPREPLY=($(compgen -W 'broadband modem lan' -- "$cur")) + _comp_compgen -- -W 'broadband modem lan' return ;; --plugin) - COMPREPLY=($(compgen -W 'cliprdr rdpsnd rdpdr' -- "$cur")) + _comp_compgen -- -W 'cliprdr rdpsnd rdpdr' return ;; /help | /version | -h | --help | --version) @@ -59,7 +59,7 @@ _comp_cmd_xfreerdp() else # old/dash syntax COMPREPLY=($(_parse_help - <<<"$help")) ((${#COMPREPLY[@]})) && - COMPREPLY=($(compgen -W '"${COMPREPLY[@]%:}"' -- "$cur")) + _comp_compgen -- -W '"${COMPREPLY[@]%:}"' fi else _comp_compgen_filedir rdp diff --git a/completions/xgamma b/completions/xgamma index a506043bdb1..3457e693d5e 100644 --- a/completions/xgamma +++ b/completions/xgamma @@ -9,7 +9,7 @@ _comp_cmd_xgamma() -screen) local screens=$(xrandr --query 2>/dev/null | command sed -n \ '/^Screen /s|^Screen \{1,\}\(.*\):.*$|\1|p' 2>/dev/null) - COMPREPLY=($(compgen -W "$screens" -- "$cur")) + _comp_compgen -- -W "$screens" return ;; -gamma | -rgamma | -ggamma | -bgamma) diff --git a/completions/xmllint b/completions/xmllint index c3e079473ec..f8ed22fabcb 100644 --- a/completions/xmllint +++ b/completions/xmllint @@ -35,7 +35,7 @@ _comp_cmd_xmllint() return ;; --pretty) - COMPREPLY=($(compgen -W '{0..2}' -- "$cur")) + _comp_compgen -- -W '{0..2}' return ;; esac diff --git a/completions/xmms b/completions/xmms index 35ef954a575..65572f8380c 100644 --- a/completions/xmms +++ b/completions/xmms @@ -12,7 +12,7 @@ _comp_cmd_xmms() return ;; --toggle-shuffle | --toggle-repeat | --toggle-advance | -${noargopts}[SRA]) - COMPREPLY=($(compgen -W 'on off' -- "$cur")) + _comp_compgen -- -W 'on off' return ;; esac diff --git a/completions/xrandr b/completions/xrandr index 3aabeef2834..3464f98d95c 100644 --- a/completions/xrandr +++ b/completions/xrandr @@ -69,20 +69,20 @@ _comp_cmd_xrandr() ;; --output | --addmode | --delmode | --dpi) local outputs=$(_comp_cmd_xrandr_outputs "$1") - COMPREPLY=($(compgen -W "$outputs" -- "$cur")) + _comp_compgen -- -W "$outputs" return ;; --left-of | --right-of | --above | --below | --same-as) if [[ $has_output ]]; then local outputs=$(_comp_cmd_xrandr_outputs "$1") - COMPREPLY=($(compgen -W "$outputs" -- "$cur")) + _comp_compgen -- -W "$outputs" fi return ;; --mode) if [[ $has_output ]]; then local modes=$(_comp_cmd_xrandr_modes "$1" "$output") - COMPREPLY=($(compgen -W "$modes" -- "$cur")) + _comp_compgen -- -W "$modes" fi return ;; @@ -94,35 +94,35 @@ _comp_cmd_xrandr() ;; --reflect) if [[ $has_output ]]; then - COMPREPLY=($(compgen -W 'normal x y xy' -- "$cur")) + _comp_compgen -- -W 'normal x y xy' fi return ;; --rotate) if [[ $has_output ]]; then - COMPREPLY=($(compgen -W 'normal inverted left right' -- "$cur")) + _comp_compgen -- -W 'normal inverted left right' fi return ;; --filter) if [[ $has_output ]]; then - COMPREPLY=($(compgen -W 'bilinear nearest' -- "$cur")) + _comp_compgen -- -W 'bilinear nearest' fi return ;; --setprovideroutputsource) local providers=$(_comp_cmd_xrandr_providers "$1" "Sink Output") - COMPREPLY=($(compgen -W "$providers" -- "$cur")) + _comp_compgen -- -W "$providers" return ;; --setprovideroffloadsink) local providers=$(_comp_cmd_xrandr_providers "$1" "Source Offload") - COMPREPLY=($(compgen -W "$providers" -- "$cur")) + _comp_compgen -- -W "$providers" return ;; --delmonitor) local monitors=$(_comp_cmd_xrandr_monitors "$1") - COMPREPLY=($(compgen -W "$monitors" -- "$cur")) + _comp_compgen -- -W "$monitors" return ;; esac @@ -135,30 +135,30 @@ _comp_cmd_xrandr() ;; --addmode) local modes=$(_comp_cmd_xrandr_all_modes "$1") - COMPREPLY=($(compgen -W "$modes" -- "$cur")) + _comp_compgen -- -W "$modes" return ;; --delmode) local modes=$(_comp_cmd_xrandr_modes "$1" "${words[cword - 1]}") - COMPREPLY=($(compgen -W "$modes" -- "$cur")) + _comp_compgen -- -W "$modes" return ;; --setmonitor) - COMPREPLY=($(compgen -W 'auto' -- "$cur")) + _comp_compgen -- -W 'auto' return ;; --setprovideroutputsource) local providers=$( _comp_cmd_xrandr_providers "$1" "Source Output" ) - COMPREPLY=($(compgen -W "0x0 $providers" -- "$cur")) + _comp_compgen -- -W "0x0 $providers" return ;; --setprovideroffloadsink) local providers=$( _comp_cmd_xrandr_providers "$1" "Sink Offload" ) - COMPREPLY=($(compgen -W "0x0 $providers" -- "$cur")) + _comp_compgen -- -W "0x0 $providers" return ;; esac @@ -169,7 +169,7 @@ _comp_cmd_xrandr() case "${words[cword - 3]}" in --setmonitor) local outputs=$(_comp_cmd_xrandr_outputs "$1") - COMPREPLY=($(compgen -W "none $outputs" -- "$cur")) + _comp_compgen -- -W "none $outputs" # TODO: the third argument is actually a comma-separated list return ;; @@ -192,7 +192,7 @@ _comp_cmd_xrandr() ) fi - COMPREPLY=($(compgen -W "$options" -- "$cur")) + _comp_compgen -- -W "$options" } && complete -F _comp_cmd_xrandr xrandr diff --git a/completions/xz b/completions/xz index b157ab4d355..86a10a73ce0 100644 --- a/completions/xz +++ b/completions/xz @@ -18,11 +18,11 @@ _comp_cmd_xz() return ;; --check | -${noargopts}C) - COMPREPLY=($(compgen -W 'crc32 crc64 sha256 none' -- "$cur")) + _comp_compgen -- -W 'crc32 crc64 sha256 none' return ;; --format | -${noargopts}F) - COMPREPLY=($(compgen -W 'auto xz lzma raw' -- "$cur")) + _comp_compgen -- -W 'auto xz lzma raw' return ;; --threads | -${noargopts}T) diff --git a/completions/yum-arch b/completions/yum-arch index 33b435f1e03..070d020b87f 100644 --- a/completions/yum-arch +++ b/completions/yum-arch @@ -6,7 +6,7 @@ _comp_cmd_yum_arch() _comp_initialize -- "$@" || return if [[ $cur == -* ]]; then - COMPREPLY=($(compgen -W '-d -v -vv -n -c -z -s -l -q' -- "$cur")) + _comp_compgen -- -W '-d -v -vv -n -c -z -s -l -q' else _comp_compgen_filedir -d fi diff --git a/completions/zopflipng b/completions/zopflipng index f05006d64b9..4e899d24488 100644 --- a/completions/zopflipng +++ b/completions/zopflipng @@ -10,7 +10,7 @@ _comp_cmd_zopflipng() return ;; --splitting) - COMPREPLY=($(compgen -W '{0..3}' -- "$cur")) + _comp_compgen -- -W '{0..3}' return ;; esac @@ -20,7 +20,7 @@ _comp_cmd_zopflipng() if [[ $cur == -* ]]; then COMPREPLY=($(_parse_help "$1" -h)) ((${#COMPREPLY[@]})) && - COMPREPLY=($(compgen -W '"${COMPREPLY[@]%:}"' -- "$cur")) + _comp_compgen -- -W '"${COMPREPLY[@]%:}"' [[ ${COMPREPLY-} == *= ]] && compopt -o nospace return fi From 87509ba8e767dc8affabc81efd119ff4a3d44d3e Mon Sep 17 00:00:00 2001 From: Koichi Murase Date: Mon, 1 May 2023 14:38:45 +0900 Subject: [PATCH 06/15] fix: use _comp_compgen for COMPREPLY+=($(compgen ... -- "$cur")) --- completions/_mount.linux | 6 +++--- completions/asciidoc | 2 +- completions/carton | 4 ++-- completions/chronyc | 2 +- completions/dnssec-keygen | 2 +- completions/feh | 4 ++-- completions/find | 2 +- completions/ip | 2 +- completions/lintian | 6 +++--- completions/lspci | 2 +- completions/mussh | 2 +- completions/mutt | 4 ++-- completions/mysql | 2 +- completions/ngrep | 2 +- completions/nslookup | 4 ++-- completions/puppet | 14 +++++++------- completions/pylint | 2 +- completions/pytest | 2 +- completions/shellcheck | 4 ++-- completions/ssh | 6 +++--- completions/upgradepkg | 2 +- completions/wodim | 4 ++-- 22 files changed, 40 insertions(+), 40 deletions(-) diff --git a/completions/_mount.linux b/completions/_mount.linux index 1295f4fabb8..2b44839cb62 100644 --- a/completions/_mount.linux +++ b/completions/_mount.linux @@ -86,7 +86,7 @@ _comp_cmd_mount() {,no}user users' -- "$cur")) case "$fstype" in adfs | auto) - COMPREPLY+=($(compgen -W '{u,g}id= {own,oth}mask=' -- "$cur")) + _comp_compgen -a -- -W '{u,g}id= {own,oth}mask=' ;;& affs | auto) COMPREPLY+=($(compgen -W '{u,g}id= set{u,g}id= mode= protect @@ -145,7 +145,7 @@ _comp_cmd_mount() iocharset= utf8' -- "$cur")) ;;& jffs2 | auto) - COMPREPLY+=($(compgen -W 'compr= rp_size=' -- "$cur")) + _comp_compgen -a -- -W 'compr= rp_size=' ;;& jfs | auto) COMPREPLY+=($(compgen -W 'iocharset= resize= {,no}integrity @@ -175,7 +175,7 @@ _comp_cmd_mount() {,no}compression debug no_detach' -- "$cur")) ;;& proc | auto) - COMPREPLY+=($(compgen -W '{u,g}id=' -- "$cur")) + _comp_compgen -a -- -W '{u,g}id=' ;;& reiserfs | auto) COMPREPLY+=($(compgen -W 'conv hash= {,no_un}hashed_relocation diff --git a/completions/asciidoc b/completions/asciidoc index 0590e28d1b3..0fcde9d95de 100644 --- a/completions/asciidoc +++ b/completions/asciidoc @@ -2,7 +2,7 @@ _comp_xfunc_asciidoc_doctype() { - COMPREPLY+=($(compgen -W 'article book manpage' -- "$cur")) + _comp_compgen -a -- -W 'article book manpage' } _comp_deprecate_func _asciidoc_doctype _comp_xfunc_asciidoc_doctype diff --git a/completions/carton b/completions/carton index bdeb2970037..d7b56b5c222 100644 --- a/completions/carton +++ b/completions/carton @@ -10,7 +10,7 @@ _comp_cmd_carton__commands() _comp_cmd_carton__command_help() { local help=$(PERLDOC_PAGER=cat PERLDOC=-otext "${1:-carton}" -h "$2" 2>&1) - COMPREPLY+=($(compgen -W '$help' -- "$cur")) + _comp_compgen -a -- -W '$help' } _comp_cmd_carton() @@ -58,7 +58,7 @@ _comp_cmd_carton() --without) if [[ $command == install ]]; then local phases="configure build test runtime develop" - COMPREPLY+=($(compgen -W '$phases' -- "$cur")) + _comp_compgen -a -- -W '$phases' return fi ;; diff --git a/completions/chronyc b/completions/chronyc index 878257578d5..1268effbe8f 100644 --- a/completions/chronyc +++ b/completions/chronyc @@ -9,7 +9,7 @@ _comp_cmd_chronyc__command_args() \) _known_hosts_real -- "$cur" ;; \<*) ;; *) ((${#args[@]})) && - COMPREPLY+=($(compgen -W '"${args[@]}"' -- "$cur")) ;; + _comp_compgen -a -- -W '"${args[@]}"' ;; esac } diff --git a/completions/dnssec-keygen b/completions/dnssec-keygen index 21097ea3f75..4685af23786 100644 --- a/completions/dnssec-keygen +++ b/completions/dnssec-keygen @@ -6,7 +6,7 @@ _comp_cmd_dnssec_keygen__optarg() command sed -e 's/|/ /g' -e 's/(.*//' \ -ne '/^[[:space:]]*'"$2"'/,/^[[:space:]]*[(-]/p' | command sed -e 's/^[[:space:]]*'"$2"'.*://' -e '/^[[:space:]]*-/d') - COMPREPLY+=($(compgen -W '$args' -- "$cur")) + _comp_compgen -a -- -W '$args' } _comp_cmd_dnssec_keygen() diff --git a/completions/feh b/completions/feh index 3f2d2813181..6f1948b6a93 100644 --- a/completions/feh +++ b/completions/feh @@ -52,7 +52,7 @@ _comp_cmd_feh() if [[ $theme_name == '#'* || $theme_name == "" ]]; then continue fi - COMPREPLY+=($(compgen -W "$theme_name" -- "$cur")) + _comp_compgen -a -- -W "$theme_name" done <"$conf_path" return ;; @@ -83,7 +83,7 @@ _comp_cmd_feh() ;; --bg | -${noargopts}b) _comp_compgen_filedir - COMPREPLY+=($(compgen -W 'trans' -- "$cur")) + _comp_compgen -a -- -W 'trans' return ;; --geometry | --max-dimension | --min-dimension | -${noargopts}g) diff --git a/completions/find b/completions/find index a3b3282e663..7c6dce1a81c 100644 --- a/completions/find +++ b/completions/find @@ -28,7 +28,7 @@ _comp_cmd_find() -fstype) _fstypes [[ $OSTYPE == *bsd* ]] && - COMPREPLY+=($(compgen -W 'local rdonly' -- "$cur")) + _comp_compgen -a -- -W 'local rdonly' return ;; -gid) diff --git a/completions/ip b/completions/ip index 5a11a8b373b..3d0da21d42b 100644 --- a/completions/ip +++ b/completions/ip @@ -128,7 +128,7 @@ _comp_cmd_ip() show) if ((cword == subcword + 1)); then _available_interfaces - COMPREPLY+=($(compgen -W 'dev group up' -- "$cur")) + _comp_compgen -a -- -W 'dev group up' elif [[ $prev == dev ]]; then _available_interfaces elif [[ $prev == group ]]; then diff --git a/completions/lintian b/completions/lintian index 876784ede14..07cc8a5f9a3 100644 --- a/completions/lintian +++ b/completions/lintian @@ -16,7 +16,7 @@ _comp_cmd_lintian__tags() elif [[ $cur == *,* ]]; then COMPREPLY+=($(compgen -P "${cur%,*}," -W "$tags" -- "${cur##*,}")) else - COMPREPLY+=($(compgen -W "$tags" -- "$cur")) + _comp_compgen -a -- -W "$tags" fi } @@ -42,7 +42,7 @@ _comp_cmd_lintian__checks() elif [[ $cur == *,* ]]; then COMPREPLY+=($(compgen -P "${cur%,*}," -W "$checks" -- "${cur##*,}")) else - COMPREPLY+=($(compgen -W "$checks" -- "$cur")) + _comp_compgen -a -- -W "$checks" fi } @@ -63,7 +63,7 @@ _comp_cmd_lintian__infos() elif [[ $cur == *,* ]]; then COMPREPLY+=($(compgen -P "${cur%,*}," -W "$infos" -- "${cur##*,}")) else - COMPREPLY+=($(compgen -W "$infos" -- "$cur")) + _comp_compgen -a -- -W "$infos" fi } diff --git a/completions/lspci b/completions/lspci index a0a3a9ec179..797a60febe7 100644 --- a/completions/lspci +++ b/completions/lspci @@ -23,7 +23,7 @@ _comp_cmd_lspci() return ;; -*H) - COMPREPLY+=($(compgen -W "1 2" -- "$cur")) + _comp_compgen -a -- -W "1 2" return ;; -*F) diff --git a/completions/mussh b/completions/mussh index f3038925539..cfeb2642cde 100644 --- a/completions/mussh +++ b/completions/mussh @@ -39,7 +39,7 @@ _comp_cmd_mussh() ;; -c) compopt -o filenames - COMPREPLY+=($(compgen -c -- "$cur")) + _comp_compgen -a -- -c return ;; esac diff --git a/completions/mutt b/completions/mutt index 777088c1c7d..70b193f95c7 100644 --- a/completions/mutt +++ b/completions/mutt @@ -106,7 +106,7 @@ _comp_cmd_mutt__aliases() aliases=($(command sed -n 's|^alias[[:space:]]\{1,\}\([^[:space:]]\{1,\}\).*$|\1|p' \ "${conffiles[@]}")) ((${#aliases[@]})) && - COMPREPLY+=($(compgen -W '"${aliases[@]}"' -- "$cur")) + _comp_compgen -a -- -W '"${aliases[@]}"' } # @param $1 (cur) Current word to complete @@ -125,7 +125,7 @@ _comp_cmd_mutt__query() command sed -n '2,$s|^\([^[:space:]]\{1,\}\).*|\1|p')) fi - COMPREPLY+=($(compgen -W "${queryresults[*]}" -- "$cur")) + _comp_compgen -a -- -W "${queryresults[*]}" } # @param $1 (cur) Current word to complete diff --git a/completions/mysql b/completions/mysql index 50da414d745..cd1d0920b66 100644 --- a/completions/mysql +++ b/completions/mysql @@ -8,7 +8,7 @@ _comp_xfunc_mysql_character_sets() charsets=("${charsets[@]##*/}") charsets=("${charsets[@]%.xml}") local IFS=$'\n' - COMPREPLY+=($(compgen -W '"${charsets[@]}"' -X '' -- "$cur")) + _comp_compgen -a -- -W '"${charsets[@]}"' -X '' } _comp_deprecate_func _mysql_character_sets _comp_xfunc_mysql_character_sets diff --git a/completions/ngrep b/completions/ngrep index dbb86281296..53736e7e726 100644 --- a/completions/ngrep +++ b/completions/ngrep @@ -15,7 +15,7 @@ _comp_cmd_ngrep() ;; -d) _available_interfaces -a - COMPREPLY+=($(compgen -W 'any' -- "$cur")) + _comp_compgen -a -- -W 'any' return ;; -W) diff --git a/completions/nslookup b/completions/nslookup index 3b17d7a8aab..5137152c533 100644 --- a/completions/nslookup +++ b/completions/nslookup @@ -2,7 +2,7 @@ _comp_cmd_nslookup__queryclass() { - COMPREPLY+=($(compgen -W 'IN CH HS ANY' -- "$cur")) + _comp_compgen -a -- -W 'IN CH HS ANY' } _comp_cmd_nslookup__querytype() @@ -20,7 +20,7 @@ _comp_cmd_nslookup__querytype() # Selected obsolete record types types+=(SPF) - COMPREPLY+=($(compgen -W '"${types[@]}"' -- "$cur")) + _comp_compgen -a -- -W '"${types[@]}"' } _comp_cmd_nslookup() diff --git a/completions/puppet b/completions/puppet index b94785e1aa8..04c26f40b77 100644 --- a/completions/puppet +++ b/completions/puppet @@ -29,7 +29,7 @@ _comp_cmd_puppet__certs() else cert_list=$("$puppetca" --list) fi - COMPREPLY+=($(compgen -W "$cert_list" -- "$cur")) + _comp_compgen -a -- -W "$cert_list" } _comp_cmd_puppet__types() @@ -37,7 +37,7 @@ _comp_cmd_puppet__types() puppet_types=$( puppet describe --list | command sed -e 's/^\(\S\{1,\}\).*$/\1/' ) - COMPREPLY+=($(compgen -W "$puppet_types" -- "$cur")) + _comp_compgen -a -- -W "$puppet_types" } _comp_cmd_puppet__references() @@ -49,7 +49,7 @@ _comp_cmd_puppet__references() puppet_doc_list=$( $puppetdoc --list | command sed -e 's/^\(\S\{1,\}\).*$/\1/' ) - COMPREPLY+=($(compgen -W "$puppet_doc_list" -- "$cur")) + _comp_compgen -a -- -W "$puppet_doc_list" } _comp_cmd_puppet__subcmd_opts() @@ -150,7 +150,7 @@ _comp_cmd_puppet() *) _comp_cmd_puppet__subcmd_opts "$1" "$subcommand" # _parse_usage doesn't grok [-D|--daemonize|--no-daemonize] - COMPREPLY+=($(compgen -W '--no-daemonize' -- "$cur")) + _comp_compgen -a -- -W '--no-daemonize' return ;; esac @@ -192,7 +192,7 @@ _comp_cmd_puppet() case $action in fingerprint | list | verify | --fingerprint | --list | \ --verify) - COMPREPLY+=($(compgen -W '--all' -- "$cur")) + _comp_compgen -a -- -W '--all' _comp_cmd_puppet__certs --all return ;; @@ -205,7 +205,7 @@ _comp_cmd_puppet() return ;; sign | --sign) - COMPREPLY+=($(compgen -W '--all' -- "$cur")) + _comp_compgen -a -- -W '--all' _comp_cmd_puppet__certs return ;; @@ -303,7 +303,7 @@ _comp_cmd_puppet() *) _comp_cmd_puppet__subcmd_opts "$1" "$subcommand" # _parse_usage doesn't grok [-D|--daemonize|--no-daemonize] - COMPREPLY+=($(compgen -W '--no-daemonize' -- "$cur")) + _comp_compgen -a -- -W '--no-daemonize' return ;; esac diff --git a/completions/pylint b/completions/pylint index c35f536d876..a4f7ec2c16a 100644 --- a/completions/pylint +++ b/completions/pylint @@ -57,7 +57,7 @@ _comp_cmd_pylint() ;; --disable | -${noargopts}d) _comp_cmd_pylint__message_ids "$1" Enabled - COMPREPLY+=($(compgen -W 'all' -- "$cur")) + _comp_compgen -a -- -W 'all' return ;; --rcfile) diff --git a/completions/pytest b/completions/pytest index af16d1b6573..676759cbd5a 100644 --- a/completions/pytest +++ b/completions/pytest @@ -5,7 +5,7 @@ _comp_cmd_pytest__option_choice_args() local modes=$("${2:-pytest}" "$1=bash-completion-nonexistent" 2>&1 | command sed -e 's/[^[:space:][:alnum:]-]\{1,\}//g' \ -ne 's/.*choose from //p') - COMPREPLY+=($(compgen -W '$modes' -- "$cur")) + _comp_compgen -a -- -W '$modes' } _comp_cmd_pytest() diff --git a/completions/shellcheck b/completions/shellcheck index cbbe693e548..d54e5d4cd27 100644 --- a/completions/shellcheck +++ b/completions/shellcheck @@ -4,7 +4,7 @@ _comp_cmd_shellcheck__optarg() { local args=$("$1" --help 2>&1 | command sed -e 's/,/ /g' -ne 's/^.*'"$2"'\>.*(\([^)]*\)).*/\1/p') - COMPREPLY+=($(compgen -W '$args' -- "$cur")) + _comp_compgen -a -- -W '$args' } _comp_cmd_shellcheck() @@ -42,7 +42,7 @@ _comp_cmd_shellcheck() ;; --source-path | -${noargopts}P) _comp_compgen_filedir -d - COMPREPLY+=($(compgen -W 'SCRIPTDIR' -- "$cur")) + _comp_compgen -a -- -W 'SCRIPTDIR' return ;; --wiki-link-count | -${noargopts}W) diff --git a/completions/ssh b/completions/ssh index 08f7d06ec2e..4417a912c11 100644 --- a/completions/ssh +++ b/completions/ssh @@ -23,7 +23,7 @@ _comp_cmd_ssh__ciphers() [[ $ciphers ]] || ciphers="3des-cbc aes128-cbc aes192-cbc aes256-cbc aes128-ctr aes192-ctr aes256-ctr arcfour128 arcfour256 arcfour blowfish-cbc cast128-cbc" - COMPREPLY+=($(compgen -W "$ciphers" -- "$cur")) + _comp_compgen -a -- -W "$ciphers" } _comp_cmd_ssh__macs() @@ -31,7 +31,7 @@ _comp_cmd_ssh__macs() local macs=$(_comp_xfunc_ssh_query "$1" mac) [[ $macs ]] || macs="hmac-md5 hmac-sha1 umac-64@openssh.com hmac-ripemd160 hmac-sha1-96 hmac-md5-96" - COMPREPLY+=($(compgen -W "$macs" -- "$cur")) + _comp_compgen -a -- -W "$macs" } _comp_xfunc_ssh_options() @@ -352,7 +352,7 @@ _comp_cmd_ssh() _count_args "=" "-*[BbcDeLpRWEFSIiJlmOoQw]" if ((args > 1)); then compopt -o filenames - COMPREPLY+=($(compgen -c -- "$cur")) + _comp_compgen -a -- -c else _known_hosts_real ${ipvx-} -a ${configfile:+-F "$configfile"} \ -- "$cur" diff --git a/completions/upgradepkg b/completions/upgradepkg index 1f7af34b882..77a7d84306c 100644 --- a/completions/upgradepkg +++ b/completions/upgradepkg @@ -18,7 +18,7 @@ _comp_cmd_upgradepkg() compopt -o filenames COMPREPLY=($(compgen -P "$prev%" -f -X "!*.@(t[bgxl]z)" -- "$cur")) [[ ${COMPREPLY-} ]] || nofiles=set - COMPREPLY+=($(compgen -P "$prev%" -S '/' -d -- "$cur")) + _comp_compgen -a -- -P "$prev%" -S '/' -d [[ $nofiles ]] && compopt -o nospace return fi diff --git a/completions/wodim b/completions/wodim index 6c4575ea066..3f05805ca60 100644 --- a/completions/wodim +++ b/completions/wodim @@ -84,10 +84,10 @@ _comp_cmd_wodim() # files are always eligible completion _comp_compgen_filedir # track options are always available - COMPREPLY+=($(compgen -W '"${track_options[@]}"' -- "$cur")) + _comp_compgen -a -- -W '"${track_options[@]}"' # general options are no more available after file or track option if [[ ! $track_mode ]]; then - COMPREPLY+=($(compgen -W '"${generic_options[@]}"' -- "$cur")) + _comp_compgen -a -- -W '"${generic_options[@]}"' fi [[ ${COMPREPLY-} == *= ]] && compopt -o nospace } && From 2a1a9e1f0b7afa309a5d2dd2c8fb692d46695573 Mon Sep 17 00:00:00 2001 From: Koichi Murase Date: Mon, 1 May 2023 14:37:25 +0900 Subject: [PATCH 07/15] fix: use _comp_compgen for COMPREPLY=($(compgen ... -- "...")) --- completions/7z | 14 +++++++------- completions/_umount.linux | 2 +- completions/dot | 4 ++-- completions/fbgs | 2 +- completions/fbi | 2 +- completions/java | 10 +++++----- completions/mutt | 2 +- completions/mypy | 2 +- completions/perltidy | 8 ++++---- completions/pkg_delete | 2 +- completions/pkgtool | 2 +- completions/portupgrade | 2 +- completions/postmap | 2 +- completions/rcs | 2 +- completions/ri | 2 +- completions/ssh-keygen | 6 +++--- completions/xfreerdp | 2 +- 17 files changed, 33 insertions(+), 33 deletions(-) diff --git a/completions/7z b/completions/7z index 70752b608ec..3c8e6cfcc19 100644 --- a/completions/7z +++ b/completions/7z @@ -15,7 +15,7 @@ _comp_cmd_7z() case $cur in -ao*) - COMPREPLY=($(compgen -P"${cur:0:3}" -W 'a s t u' -- "${cur:3}")) + _comp_compgen -c "${cur:3}" -- -P"${cur:0:3}" -W 'a s t u' return ;; -?(a)[ix]*) @@ -31,18 +31,18 @@ _comp_cmd_7z() elif [[ $cur == ?(r@(-|0|))@* ]]; then local IFS=$' \t\n' reset=$(shopt -po noglob) set -o noglob - COMPREPLY=($(compgen -P"${opt}${cur%%@*}@" -f -- "${cur#*@}")) + _comp_compgen -c "${cur#*@}" -- -P"${opt}${cur%%@*}@" -f $reset compopt -o filenames fi return ;; -mhe=* | -mhc=* | -ms=* | -mt=*) - COMPREPLY=($(compgen -W 'on off' -- "${cur#*=}")) + _comp_compgen -c "${cur#*=}" -- -W 'on off' return ;; -mx=*) - COMPREPLY=($(compgen -W '0 1 3 5 7 9' -- "${cur#*=}")) + _comp_compgen -c "${cur#*=}" -- -W '0 1 3 5 7 9' return ;; -o* | -w?*) @@ -50,14 +50,14 @@ _comp_cmd_7z() set -o noglob compopt -o filenames local IFS=$'\n' - COMPREPLY=($(compgen -d -P"${cur:0:2}" -S/ -- "${cur:2}")) + _comp_compgen -c "${cur:2}" -- -d -P"${cur:0:2}" -S/ _comp_unlocal IFS $reset compopt -o nospace return ;; -r?*) - COMPREPLY=($(compgen -P"${cur:0:2}" -W '- 0' -- "${cur:2}")) + _comp_compgen -c "${cur:2}" -- -P"${cur:0:2}" -W '- 0' return ;; -scs*) @@ -66,7 +66,7 @@ _comp_cmd_7z() return ;; -ssc?*) - COMPREPLY=($(compgen -P"${cur:0:4}" -W '-' -- "${cur:4}")) + _comp_compgen -c "${cur:4}" -- -P"${cur:0:4}" -W '-' return ;; -t*) diff --git a/completions/_umount.linux b/completions/_umount.linux index 321df9504c3..30f950797c0 100644 --- a/completions/_umount.linux +++ b/completions/_umount.linux @@ -28,7 +28,7 @@ _comp_cmd_umount__reply_compgen_array() # Actually generate completions. local IFS=$'\n' - COMPREPLY=($(compgen -W "$wlist" -- "${ecur}")) + _comp_compgen -c "${ecur}" -- -W "$wlist" _comp_unlocal IFS } diff --git a/completions/dot b/completions/dot index aa3b8157964..c1b4d51155d 100644 --- a/completions/dot +++ b/completions/dot @@ -15,14 +15,14 @@ _comp_cmd_dot() local langs=($("$1" -TNON_EXISTENT 2>&1 | command sed -ne 's/.*one of://p')) ((${#langs[@]})) && - COMPREPLY=($(compgen -P -T -W '"${langs[@]}"' -- "${cur#-T}")) + _comp_compgen -c "${cur#-T}" -- -P -T -W '"${langs[@]}"' return ;; -K*) local layouts=($("$1" -KNON_EXISTENT 2>&1 | command sed -ne 's/.*one of://p')) ((${#layouts[@]})) && - COMPREPLY=($(compgen -P -K -W '"${layouts[@]}"' -- "${cur#-K}")) + _comp_compgen -c "${cur#-K}" -- -P -K -W '"${layouts[@]}"' return ;; -o*) diff --git a/completions/fbgs b/completions/fbgs index f720f48258b..2541acb1e92 100644 --- a/completions/fbgs +++ b/completions/fbgs @@ -18,7 +18,7 @@ _comp_cmd_fbgs() return ;; -d | --device) - COMPREPLY=($(compgen -f -d -- "${cur:-/dev/}")) + _comp_compgen -c "${cur:-/dev/}" -- -f -d return ;; -fp | --firstpage | -lp | --lastpage | -r | --resolution | -s | --scroll | -t | \ diff --git a/completions/fbi b/completions/fbi index 50edad60bcc..5b5732ae2ad 100644 --- a/completions/fbi +++ b/completions/fbi @@ -26,7 +26,7 @@ _comp_cmd_fbi() return ;; -d | --device) - COMPREPLY=($(compgen -f -d -- "${cur:-/dev/}")) + _comp_compgen -c "${cur:-/dev/}" -- -f -d return ;; --cachemem | --blend | -T | --vt | -s | --scroll | -t | --timeout | -g | --gamma) diff --git a/completions/java b/completions/java index 13ebf49f1d4..a2376f57e48 100644 --- a/completions/java +++ b/completions/java @@ -160,7 +160,7 @@ _comp_cmd_java() case $cur in # standard option completions -verbose:*) - COMPREPLY=($(compgen -W 'class gc jni' -- "${cur#*:}")) + _comp_compgen -c "${cur#*:}" -- -W 'class gc jni' return ;; -javaagent:*) @@ -181,7 +181,7 @@ _comp_cmd_java() return ;; -Xcheck:*) - COMPREPLY=($(compgen -W 'jni' -- "${cur#*:}")) + _comp_compgen -c "${cur#*:}" -- -W 'jni' return ;; -Xgc:*) @@ -199,7 +199,7 @@ _comp_cmd_java() return ;; -Xshare:*) - COMPREPLY=($(compgen -W 'auto off on' -- "${cur#*:}")) + _comp_compgen -c "${cur#*:}" -- -W 'auto off on' return ;; -Xverbose:*) @@ -208,7 +208,7 @@ _comp_cmd_java() return ;; -Xverify:*) - COMPREPLY=($(compgen -W 'all none remote' -- "${cur#*:}")) + _comp_compgen -c "${cur#*:}" -- -W 'all none remote' return ;; # the rest that we have no completions for @@ -316,7 +316,7 @@ _comp_cmd_javac() # the others. local opts=$("$1" $helpopt 2>&1 | command sed -e 's/-g:none/-g:{none}/' -ne \ "s/^[[:space:]]*${cur%%:*}:{\([^}]\{1,\}\)}.*/\1/p") - COMPREPLY=($(compgen -W "${opts//,/ }" -- "${cur#*:}")) + _comp_compgen -c "${cur#*:}" -- -W "${opts//,/ }" return fi diff --git a/completions/mutt b/completions/mutt index 70b193f95c7..20f7d90399b 100644 --- a/completions/mutt +++ b/completions/mutt @@ -141,7 +141,7 @@ _comp_cmd_mutt__filedir() # Match any file in $folder beginning with $cur # (minus the leading '=' sign). compopt -o filenames - COMPREPLY=($(compgen -f -- "$folder/${cur:1}")) + _comp_compgen -c "$folder/${cur:1}" -- -f COMPREPLY=(${COMPREPLY[@]#$folder/}) return elif [[ $cur == !* ]]; then diff --git a/completions/mypy b/completions/mypy index c294f14f5c4..46a9bc83ceb 100644 --- a/completions/mypy +++ b/completions/mypy @@ -25,7 +25,7 @@ _comp_cmd_mypy() return ;; --python-executable) - COMPREPLY=($(compgen -c -- "${cur:-py}")) + _comp_compgen -c "${cur:-py}" -- -c return ;; --*-dir | --*-report) diff --git a/completions/perltidy b/completions/perltidy index 4c5e7c2f39f..ec089fa42a7 100644 --- a/completions/perltidy +++ b/completions/perltidy @@ -21,7 +21,7 @@ _comp_cmd_perltidy() return ;; -ole=* | --output-line-ending=*) - COMPREPLY=($(compgen -W 'dos win mac unix' -- "${cur#*=}")) + _comp_compgen -c "${cur#*=}" -- -W 'dos win mac unix' return ;; -bt=* | --brace-tightness=* | -pt=* | --paren-tightness=* | \ @@ -35,15 +35,15 @@ _comp_cmd_perltidy() -cti=* | --closing-token-indentation=* | \ -kbl=* | --keep-old-blank-lines=* | \ -vt=* | --vertical-tightness=*) - COMPREPLY=($(compgen -W '0 1 2' -- "${cur#*=}")) + _comp_compgen -c "${cur#*=}" -- -W '0 1 2' return ;; -vtc=* | --vertical-tightness-closing=*) - COMPREPLY=($(compgen -W '0 1' -- "${cur#*=}")) + _comp_compgen -c "${cur#*=}" -- -W '0 1' return ;; -cab=* | --comma-arrow-breakpoints=*) - COMPREPLY=($(compgen -W '0 1 2 3' -- "${cur#*=}")) + _comp_compgen -c "${cur#*=}" -- -W '0 1 2 3' return ;; -*=) diff --git a/completions/pkg_delete b/completions/pkg_delete index 87b995466c6..beec1c8bcb6 100644 --- a/completions/pkg_delete +++ b/completions/pkg_delete @@ -9,7 +9,7 @@ _comp_cmd_pkg_delete() [[ $prev == -o || $prev == -p || $prev == -W ]] && return - COMPREPLY=($(compgen -d -- "$pkgdir$cur")) + _comp_compgen -c "$pkgdir$cur" -- -d ((${#COMPREPLY[@]} == 0)) || COMPREPLY=(${COMPREPLY[@]#$pkgdir}) } && diff --git a/completions/pkgtool b/completions/pkgtool index 85ffd8c624f..141e65559c2 100644 --- a/completions/pkgtool +++ b/completions/pkgtool @@ -15,7 +15,7 @@ _comp_cmd_pkgtool() return ;; --source_device) - COMPREPLY=($(compgen -f -d -- "${cur:-/dev/}")) + _comp_compgen -c "${cur:-/dev/}" -- -f -d return ;; --tagfile) diff --git a/completions/portupgrade b/completions/portupgrade index d5955b05ebd..ef74a090bf1 100644 --- a/completions/portupgrade +++ b/completions/portupgrade @@ -9,7 +9,7 @@ _comp_cmd_portupgrade() local pkgdir=${PKG_DBDIR:-/var/db/pkg}/ - COMPREPLY=($(compgen -d -- "$pkgdir$cur")) + _comp_compgen -c "$pkgdir$cur" -- -d COMPREPLY=(${COMPREPLY[@]#$pkgdir}) COMPREPLY=(${COMPREPLY[@]%-*}) diff --git a/completions/postmap b/completions/postmap index 4910589869a..bd99127ff20 100644 --- a/completions/postmap +++ b/completions/postmap @@ -22,7 +22,7 @@ _comp_cmd_postmap() if [[ $cur == *:* ]]; then compopt -o filenames - COMPREPLY=($(compgen -f -- "${cur#*:}")) + _comp_compgen -c "${cur#*:}" -- -f else local len=${#cur} pval for pval in $(/usr/sbin/postconf -m 2>/dev/null); do diff --git a/completions/rcs b/completions/rcs index 46f3b31fd81..d7a3c135706 100644 --- a/completions/rcs +++ b/completions/rcs @@ -13,7 +13,7 @@ _comp_cmd_rcs() # deal with relative directory [[ $file == "$dir" ]] && dir=. - COMPREPLY=($(compgen -f -- "$dir/RCS/$file")) + _comp_compgen -c "$dir/RCS/$file" -- -f for i in ${!COMPREPLY[*]}; do file=${COMPREPLY[i]##*/} diff --git a/completions/ri b/completions/ri index ebe24816de5..60a8a343ff7 100644 --- a/completions/ri +++ b/completions/ri @@ -29,7 +29,7 @@ _comp_cmd_ri__methods() end' | sort -u)") fi ((${#COMPREPLY[@]})) && - COMPREPLY=($(compgen "$prefix" -W '"${COMPREPLY[@]}"' -- "$method")) + _comp_compgen -c "$method" -- "$prefix" -W '"${COMPREPLY[@]}"' } # needs at least Ruby 1.8.0 in order to use -W0 diff --git a/completions/ssh-keygen b/completions/ssh-keygen index 775d3d1331f..fb2eac67515 100644 --- a/completions/ssh-keygen +++ b/completions/ssh-keygen @@ -79,17 +79,17 @@ _comp_cmd_ssh_keygen() case $cur in force-command=*) compopt -o filenames - COMPREPLY=($(compgen -c -- "${cur#*=}")) + _comp_compgen -c "${cur#*=}" -- -c ;; checkpoint=* | challenge=* | write-attestation=*) _comp_compgen -c "${cur#*=}" filedir ;; application=*([^:=])) - COMPREPLY=($(compgen -W "ssh:" -- "${cur#*=}")) + _comp_compgen -c "${cur#*=}" -- -W "ssh:" compopt -o nospace ;; user=*) - COMPREPLY=($(compgen -u -- "${cur#*=}")) + _comp_compgen -c "${cur#*=}" -- -u ;; esac fi diff --git a/completions/xfreerdp b/completions/xfreerdp index a237dae9712..73853155b38 100644 --- a/completions/xfreerdp +++ b/completions/xfreerdp @@ -35,7 +35,7 @@ _comp_cmd_xfreerdp() return ;; /bpp:*) - COMPREPLY=($(compgen -W '8 15 16 24 32' -- "${cur#/bpp:}")) + _comp_compgen -c "${cur#/bpp:}" -- -W '8 15 16 24 32' return ;; /*:*) From 7f6ba5b26bb0a560bcb193b36e4751c573a9c592 Mon Sep 17 00:00:00 2001 From: Koichi Murase Date: Mon, 1 May 2023 14:38:45 +0900 Subject: [PATCH 08/15] fix: use _comp_compgen for COMPREPLY+=($(compgen ... -- "...")) --- completions/kill | 2 +- completions/lintian | 6 +++--- completions/mutt | 2 +- completions/ssh | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/completions/kill b/completions/kill index 71e2072bad2..cd0ad4d208e 100644 --- a/completions/kill +++ b/completions/kill @@ -22,7 +22,7 @@ _comp_cmd_kill() else # return list of available PIDs and jobs _pids - COMPREPLY+=($(compgen -j -P % -- "${cur#%}")) + _comp_compgen -ac "${cur#%}" -- -j -P % fi } && complete -F _comp_cmd_kill kill diff --git a/completions/lintian b/completions/lintian index 07cc8a5f9a3..208e17930f7 100644 --- a/completions/lintian +++ b/completions/lintian @@ -14,7 +14,7 @@ _comp_cmd_lintian__tags() done COMPREPLY+=($(compgen -W "$tags")) elif [[ $cur == *,* ]]; then - COMPREPLY+=($(compgen -P "${cur%,*}," -W "$tags" -- "${cur##*,}")) + _comp_compgen -ac "${cur##*,}" -- -P "${cur%,*}," -W "$tags" else _comp_compgen -a -- -W "$tags" fi @@ -40,7 +40,7 @@ _comp_cmd_lintian__checks() done COMPREPLY+=($(compgen -W "$checks")) elif [[ $cur == *,* ]]; then - COMPREPLY+=($(compgen -P "${cur%,*}," -W "$checks" -- "${cur##*,}")) + _comp_compgen -ac "${cur##*,}" -- -P "${cur%,*}," -W "$checks" else _comp_compgen -a -- -W "$checks" fi @@ -61,7 +61,7 @@ _comp_cmd_lintian__infos() done COMPREPLY+=($(compgen -W "$infos")) elif [[ $cur == *,* ]]; then - COMPREPLY+=($(compgen -P "${cur%,*}," -W "$infos" -- "${cur##*,}")) + _comp_compgen -ac "${cur##*,}" -- -P "${cur%,*}," -W "$infos" else _comp_compgen -a -- -W "$infos" fi diff --git a/completions/mutt b/completions/mutt index 20f7d90399b..a77c489d19a 100644 --- a/completions/mutt +++ b/completions/mutt @@ -9,7 +9,7 @@ _comp_cmd_mutt__addresses() _comp_cmd_mutt__aliases "$1" _comp_cmd_mutt__query "$1" - COMPREPLY+=($(compgen -u -- "$1")) + _comp_compgen -ac "$1" -- -u } # Find muttrc to use diff --git a/completions/ssh b/completions/ssh index 4417a912c11..13bf2035ac9 100644 --- a/completions/ssh +++ b/completions/ssh @@ -7,7 +7,7 @@ _comp_cmd_ssh__queries() key-plain key-sig protocol-version compression sig ciphers macs kexalgorithms pubkeyacceptedkeytypes hostkeyalgorithms hostbasedkeytypes hostbasedacceptedkeytypes" - COMPREPLY+=($(compgen -W "$queries help" -- "${cur,,}")) + _comp_compgen -ac "${cur,,}" -- -W "$queries help" } _comp_xfunc_ssh_query() From e88fca55a57273dd94c95447d214e98cdc93ae71 Mon Sep 17 00:00:00 2001 From: Koichi Murase Date: Mon, 1 May 2023 14:37:25 +0900 Subject: [PATCH 09/15] fix: use _comp_compgen for COMPREPLY=($(compgen ...)) --- completions/_mount.linux | 2 +- completions/feh | 2 +- completions/hping2 | 2 +- completions/tar | 4 ++-- completions/wget | 6 +++--- completions/xgamma | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/completions/_mount.linux b/completions/_mount.linux index 2b44839cb62..f766fffc0fb 100644 --- a/completions/_mount.linux +++ b/completions/_mount.linux @@ -32,7 +32,7 @@ _comp_cmd_mount() return ;; -p | --pass-fd) - COMPREPLY=($(compgen -W '{0..9}')) + _comp_compgen -R -- -W '{0..9}' compopt -o nospace return ;; diff --git a/completions/feh b/completions/feh index 6f1948b6a93..d047f656736 100644 --- a/completions/feh +++ b/completions/feh @@ -23,7 +23,7 @@ _comp_cmd_feh() --font | --menu-font | --title-font | -${noargopts}[eM@]) # expect string like "dejavu.ttf/12" if [[ $cur == */* ]]; then # expect integer value - COMPREPLY=($(compgen -P "$cur" -W '{0..9}')) + _comp_compgen -R -- -P "$cur" -W '{0..9}' compopt -o nospace return fi diff --git a/completions/hping2 b/completions/hping2 index 46d0ec75177..dcd390f7486 100644 --- a/completions/hping2 +++ b/completions/hping2 @@ -17,7 +17,7 @@ _comp_cmd_hping2() return ;; --tos | -${noargopts}o) - COMPREPLY=($(compgen -W '02 04 08 10')) + _comp_compgen -R -- -W '02 04 08 10' return ;; --file | -${noargopts}E) diff --git a/completions/tar b/completions/tar index 9bcc43d4f76..8c91ade8fcb 100644 --- a/completions/tar +++ b/completions/tar @@ -308,7 +308,7 @@ _comp_cmd_tar__mode() generated+=" $filler$cur$c" done - COMPREPLY=($(compgen -W "$generated")) + _comp_compgen -R -- -W "$generated" return 0 fi @@ -331,7 +331,7 @@ _comp_cmd_tar__mode() generated+=" $cur$c" done - COMPREPLY=($(compgen -W "$generated")) + _comp_compgen -R -- -W "$generated" return 0 } diff --git a/completions/wget b/completions/wget index 5dc7b7d63d5..884dab7ff19 100644 --- a/completions/wget +++ b/completions/wget @@ -111,12 +111,12 @@ _comp_cmd_wget() --quota | --limit-rate | --warc-max-size | -${noargopts}Q) # expect size if [[ $cur == *[km] ]]; then - COMPREPLY=($(compgen -W "$cur")) + _comp_compgen -R -- -W "$cur" elif [[ $cur ]]; then - COMPREPLY=($(compgen -P "$cur" -W "{0..9} k m")) + _comp_compgen -R -- -P "$cur" -W "{0..9} k m" compopt -o nospace else - COMPREPLY=($(compgen -W "{0..9}")) + _comp_compgen -R -- -W "{0..9}" compopt -o nospace fi return diff --git a/completions/xgamma b/completions/xgamma index 3457e693d5e..5a3c7f93012 100644 --- a/completions/xgamma +++ b/completions/xgamma @@ -26,7 +26,7 @@ _comp_cmd_xgamma() if [[ $cur == :* && $cur != :*.* ]]; then # FIXME: where to get local display numbers? local display=${cur#:} - COMPREPLY=($(compgen -W "${display:-0}.")) + _comp_compgen -R -- -W "${display:-0}." compopt -o nospace elif [[ $cur == :*.* ]]; then # local screen numbers From 446b599464bce87090647edf50699735b3d0e701 Mon Sep 17 00:00:00 2001 From: Koichi Murase Date: Mon, 1 May 2023 14:38:45 +0900 Subject: [PATCH 10/15] fix: use _comp_compgen for COMPREPLY+=($(compgen ...)) --- completions/fbgs | 2 +- completions/fbi | 2 +- completions/feh | 6 +++--- completions/lintian | 6 +++--- completions/nethogs | 2 +- completions/rcs | 2 +- completions/useradd | 2 +- completions/usermod | 2 +- completions/wget | 2 +- completions/xgamma | 2 +- 10 files changed, 14 insertions(+), 14 deletions(-) diff --git a/completions/fbgs b/completions/fbgs index 2541acb1e92..255066dcc6a 100644 --- a/completions/fbgs +++ b/completions/fbgs @@ -24,7 +24,7 @@ _comp_cmd_fbgs() -fp | --firstpage | -lp | --lastpage | -r | --resolution | -s | --scroll | -t | \ --timeout) # expect integer value - COMPREPLY+=($(compgen -W '{0..9}')) + _comp_compgen -aR -- -W '{0..9}' compopt -o nospace return ;; diff --git a/completions/fbi b/completions/fbi index 5b5732ae2ad..791445dd9d0 100644 --- a/completions/fbi +++ b/completions/fbi @@ -11,7 +11,7 @@ _comp_cmd_fbi() return ;; -r | --resolution) - COMPREPLY+=($(compgen -W '{1..5}')) + _comp_compgen -aR -- -W '{1..5}' return ;; -f | --font) diff --git a/completions/feh b/completions/feh index d047f656736..4a0293b0c7b 100644 --- a/completions/feh +++ b/completions/feh @@ -64,7 +64,7 @@ _comp_cmd_feh() --reload | --limit-height | --limit-width | --thumb-height | --thumb-width | \ --thumb-redraw | --magick-timeout | -${noargopts}[RHWEyJ]) # expect integer value - COMPREPLY+=($(compgen -W '{0..9}')) + _comp_compgen -aR -- -W '{0..9}' compopt -o nospace return ;; @@ -72,7 +72,7 @@ _comp_cmd_feh() # expect integer value or "max", "fill" _comp_compgen -- -W 'max fill' if [[ ! $cur || ! ${COMPREPLY-} ]]; then - COMPREPLY+=($(compgen -W '{0..9}')) + _comp_compgen -aR -- -W '{0..9}' compopt -o nospace fi return @@ -91,7 +91,7 @@ _comp_cmd_feh() if [[ $cur && $cur != *x* ]]; then COMPREPLY=(x) fi - COMPREPLY+=($(compgen -W "{0..9}")) + _comp_compgen -aR -- -W "{0..9}" compopt -o nospace return ;; diff --git a/completions/lintian b/completions/lintian index 208e17930f7..db782e04cd8 100644 --- a/completions/lintian +++ b/completions/lintian @@ -12,7 +12,7 @@ _comp_cmd_lintian__tags() for item in $search; do tags=$(command sed -e "s/\<$item\>//g" <<<"$tags") done - COMPREPLY+=($(compgen -W "$tags")) + _comp_compgen -aR -- -W "$tags" elif [[ $cur == *,* ]]; then _comp_compgen -ac "${cur##*,}" -- -P "${cur%,*}," -W "$tags" else @@ -38,7 +38,7 @@ _comp_cmd_lintian__checks() checks=$(command sed -e "s/\<$name\>//g" <<<"$checks") done done - COMPREPLY+=($(compgen -W "$checks")) + _comp_compgen -aR -- -W "$checks" elif [[ $cur == *,* ]]; then _comp_compgen -ac "${cur##*,}" -- -P "${cur%,*}," -W "$checks" else @@ -59,7 +59,7 @@ _comp_cmd_lintian__infos() for item in $search; do infos=$(command sed -e "s/\<$item\>//g" <<<"$infos") done - COMPREPLY+=($(compgen -W "$infos")) + _comp_compgen -aR -- -W "$infos" elif [[ $cur == *,* ]]; then _comp_compgen -ac "${cur##*,}" -- -P "${cur%,*}," -W "$infos" else diff --git a/completions/nethogs b/completions/nethogs index b74d5a3ba37..4b4673e0509 100644 --- a/completions/nethogs +++ b/completions/nethogs @@ -8,7 +8,7 @@ _comp_cmd_nethogs() case "$prev" in -d) # expect integer value - COMPREPLY+=($(compgen -W '{0..9}')) + _comp_compgen -aR -- -W '{0..9}' compopt -o nospace return ;; diff --git a/completions/rcs b/completions/rcs index d7a3c135706..aab018e2473 100644 --- a/completions/rcs +++ b/completions/rcs @@ -21,7 +21,7 @@ _comp_cmd_rcs() COMPREPLY[i]=$dir$file done - COMPREPLY+=($(compgen -G "$dir/$file*,v")) + _comp_compgen -aR -- -G "$dir/$file*,v" for i in ${!COMPREPLY[*]}; do COMPREPLY[i]=${COMPREPLY[i]%,v} diff --git a/completions/useradd b/completions/useradd index 94889484e11..f583f27568a 100644 --- a/completions/useradd +++ b/completions/useradd @@ -30,7 +30,7 @@ _comp_cmd_useradd() ;; --gid | -${noargopts}g) _gids - COMPREPLY+=($(compgen -g)) + _comp_compgen -aR -- -g ((${#COMPREPLY[@]})) && _comp_compgen -- -W '"${COMPREPLY[@]}"' return diff --git a/completions/usermod b/completions/usermod index d485d22d592..dee9404f681 100644 --- a/completions/usermod +++ b/completions/usermod @@ -26,7 +26,7 @@ _comp_cmd_usermod() ;; --gid | -${noargopts}g) _gids - COMPREPLY+=($(compgen -g)) + _comp_compgen -aR -- -g ((${#COMPREPLY[@]})) && _comp_compgen -- -W '"${COMPREPLY[@]}"' return diff --git a/completions/wget b/completions/wget index 884dab7ff19..44be80ae786 100644 --- a/completions/wget +++ b/completions/wget @@ -104,7 +104,7 @@ _comp_cmd_wget() --read-timeout | --wait | --waitretry | --cut-dirs | \ --max-redirect | --level | -${noargopts}[tTwl]) # expect integer number - COMPREPLY+=($(compgen -P "$cur" -W "{0..9}")) + _comp_compgen -aR -- -P "$cur" -W "{0..9}" compopt -o nospace return ;; diff --git a/completions/xgamma b/completions/xgamma index 5a3c7f93012..8f3b6eab165 100644 --- a/completions/xgamma +++ b/completions/xgamma @@ -17,7 +17,7 @@ _comp_cmd_xgamma() if [[ $cur && $cur != *.* ]]; then COMPREPLY=(.) fi - COMPREPLY+=($(compgen -W "{0..9}")) + _comp_compgen -aR -- -W "{0..9}" compopt -o nospace return ;; From 735248636e2365fe7e2be7599243936c4552d9eb Mon Sep 17 00:00:00 2001 From: Koichi Murase Date: Wed, 3 May 2023 21:22:41 +0900 Subject: [PATCH 11/15] refactor: clean up old IFS/noglob handling --- completions/7z | 8 -------- completions/_su | 1 - completions/_umount.linux | 4 +--- completions/help | 1 - completions/hunspell | 1 - completions/mysql | 1 - completions/perl | 2 -- completions/vpnc | 1 - completions/xdg-mime | 1 - 9 files changed, 1 insertion(+), 19 deletions(-) diff --git a/completions/7z b/completions/7z index 3c8e6cfcc19..b0fcc4c60ef 100644 --- a/completions/7z +++ b/completions/7z @@ -29,10 +29,7 @@ _comp_cmd_7z() COMPREPLY=($(compgen -P"$opt" -W '@ ! r@ r-@ r0@ r! r-! r0!' \ -- "$cur")) elif [[ $cur == ?(r@(-|0|))@* ]]; then - local IFS=$' \t\n' reset=$(shopt -po noglob) - set -o noglob _comp_compgen -c "${cur#*@}" -- -P"${opt}${cur%%@*}@" -f - $reset compopt -o filenames fi return @@ -46,13 +43,8 @@ _comp_cmd_7z() return ;; -o* | -w?*) - local reset=$(shopt -po noglob) - set -o noglob compopt -o filenames - local IFS=$'\n' _comp_compgen -c "${cur:2}" -- -d -P"${cur:0:2}" -S/ - _comp_unlocal IFS - $reset compopt -o nospace return ;; diff --git a/completions/_su b/completions/_su index 16a487adcc1..a0737249e7c 100644 --- a/completions/_su +++ b/completions/_su @@ -19,7 +19,6 @@ _comp_cmd_su() return ;; -c | --command | --session-command) - local IFS=$'\n' compopt -o filenames _comp_compgen -- -d -c return diff --git a/completions/_umount.linux b/completions/_umount.linux index 30f950797c0..fbad146e07f 100644 --- a/completions/_umount.linux +++ b/completions/_umount.linux @@ -27,9 +27,7 @@ _comp_cmd_umount__reply_compgen_array() ecur=${ecur//\'/\\\'} # Actually generate completions. - local IFS=$'\n' - _comp_compgen -c "${ecur}" -- -W "$wlist" - _comp_unlocal IFS + _comp_compgen -lc "${ecur}" -- -W "$wlist" } # Unescape strings in the linux fstab(5) format (with octal escapes). diff --git a/completions/help b/completions/help index 80992adceaf..a2d53ebe359 100644 --- a/completions/help +++ b/completions/help @@ -10,7 +10,6 @@ _comp_cmd_help() return fi - local IFS=$'\t\n' _comp_compgen -- -A helptopic ((${#COMPREPLY[*]} != 1)) || printf -v "COMPREPLY[0]" %q "$COMPREPLY" } && diff --git a/completions/hunspell b/completions/hunspell index fe9c6a5d738..cccc443c459 100644 --- a/completions/hunspell +++ b/completions/hunspell @@ -15,7 +15,6 @@ _comp_cmd_hunspell() if ((${#dicts[@]})); then dicts=("${dicts[@]##*/}") dicts=("${dicts[@]%.dic}") - local IFS=$'\n' _comp_compgen -- -W '"${dicts[@]}"' fi return diff --git a/completions/mysql b/completions/mysql index cd1d0920b66..09701e5afdf 100644 --- a/completions/mysql +++ b/completions/mysql @@ -7,7 +7,6 @@ _comp_xfunc_mysql_character_sets() charsets+=(utf8) charsets=("${charsets[@]##*/}") charsets=("${charsets[@]%.xml}") - local IFS=$'\n' _comp_compgen -a -- -W '"${charsets[@]}"' -X '' } diff --git a/completions/perl b/completions/perl index 7356e85e6f4..396db56fda8 100644 --- a/completions/perl +++ b/completions/perl @@ -33,7 +33,6 @@ _comp_cmd_perl() return ;; -*[Ix]) - local IFS=$'\n' compopt -o filenames _comp_compgen -- -d "$optPrefix" $optSuffix return @@ -78,7 +77,6 @@ _comp_cmd_perl() # Likewise, `-I' also accepts a space between option and argument # and it takes a directory as value. elif [[ $prev == -I ]]; then - local IFS=$'\n' compopt -o filenames # shellcheck disable=SC2086 _comp_compgen -- -d ${optPrefix-} ${optSuffix-} diff --git a/completions/vpnc b/completions/vpnc index 8deebdb208f..dd2cfb81d4c 100644 --- a/completions/vpnc +++ b/completions/vpnc @@ -72,7 +72,6 @@ _vpnc() if ((${#configs[@]})); then configs=("${configs[@]##*/}") configs=("${configs[@]%.conf}") - local IFS=$'\n' compopt -o filenames _comp_compgen -- -W '"${configs[@]}"' fi diff --git a/completions/xdg-mime b/completions/xdg-mime index 8b6c53b14e0..1787115ecb2 100644 --- a/completions/xdg-mime +++ b/completions/xdg-mime @@ -59,7 +59,6 @@ _comp_cmd_xdg_mime() _comp_expand_glob desktops '/usr/share/applications/*.desktop' if ((${#desktops[@]})); then desktops=("${desktops[@]##*/}") - local IFS=$'\n' _comp_compgen -- -W '"${desktops[@]}"' fi else From 2c9a1a979565fecc3d352c23669e5f084e2f1f0f Mon Sep 17 00:00:00 2001 From: Koichi Murase Date: Sun, 7 May 2023 20:18:17 +0900 Subject: [PATCH 12/15] fix(_comp_cmd_smartctl__device): replace COMPREPLY --- completions/smartctl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/completions/smartctl b/completions/smartctl index 476c877982e..35c2ba59b71 100644 --- a/completions/smartctl +++ b/completions/smartctl @@ -5,12 +5,12 @@ _comp_cmd_smartctl__device() case $cur in areca* | 3ware* | megaraid* | cciss*) # shellcheck disable=SC2054 - COMPREPLY+=(${cur%%,*},{0..31}) + COMPREPLY=(${cur%%,*},{0..31}) _comp_compgen -- -W '"${COMPREPLY[@]}"' ;; hpt*) # shellcheck disable=SC2054 - COMPREPLY+=(hpt,{1..4}/{1..8} hpt,{1..4}/{1..8}/{1..5}) + COMPREPLY=(hpt,{1..4}/{1..8} hpt,{1..4}/{1..8}/{1..5}) _comp_compgen -- -W '"${COMPREPLY[@]}"' ;; *) From 5fe66d83481ce37d725e0bfb0802c6c6eded4ddd Mon Sep 17 00:00:00 2001 From: Koichi Murase Date: Sun, 7 May 2023 20:34:31 +0900 Subject: [PATCH 13/15] refactor: reduce trivial `_comp_compgen -- -W '"${COMPREPLY[@]}"'` MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit There are also more non-trivial cases where COMPREPLY is first constructed and then filtered by `_comp_compgen -- -W '"${COMPREPLY[@]}"'`, but they would conflict with forthcoming other PRs for _comp_compgen rewrite. We will address them after finishing the _comp_compgen-related PRs. Co-authored-by: Ville Skyttä --- completions/ifup | 2 -- completions/ip | 3 +-- completions/smartctl | 8 ++------ completions/tune2fs | 6 ++---- completions/useradd | 4 +--- completions/usermod | 4 +--- 6 files changed, 7 insertions(+), 20 deletions(-) diff --git a/completions/ifup b/completions/ifup index c57e56bec25..99165ae2522 100644 --- a/completions/ifup +++ b/completions/ifup @@ -33,8 +33,6 @@ _comp_cmd_ifupdown() if ((args == 1)); then _configured_interfaces - ((${#COMPREPLY[@]})) && - _comp_compgen -- -W '"${COMPREPLY[@]}"' fi } && complete -F _comp_cmd_ifupdown ifup ifdown ifquery ifstatus diff --git a/completions/ip b/completions/ip index 3d0da21d42b..fd4fcf205a4 100644 --- a/completions/ip +++ b/completions/ip @@ -334,8 +334,7 @@ _comp_cmd_ip() if [[ $cword -eq $subcword+1 || $prev == dev ]]; then _available_interfaces if [[ $prev != dev ]]; then - COMPREPLY+=(dev) - _comp_compgen -- -W '"${COMPREPLY[@]}"' + _comp_compgen -a -W dev fi fi ;; diff --git a/completions/smartctl b/completions/smartctl index 35c2ba59b71..05c05d06671 100644 --- a/completions/smartctl +++ b/completions/smartctl @@ -4,14 +4,10 @@ _comp_cmd_smartctl__device() { case $cur in areca* | 3ware* | megaraid* | cciss*) - # shellcheck disable=SC2054 - COMPREPLY=(${cur%%,*},{0..31}) - _comp_compgen -- -W '"${COMPREPLY[@]}"' + _comp_compgen -- -W '${cur%%,*},{0..31}' ;; hpt*) - # shellcheck disable=SC2054 - COMPREPLY=(hpt,{1..4}/{1..8} hpt,{1..4}/{1..8}/{1..5}) - _comp_compgen -- -W '"${COMPREPLY[@]}"' + _comp_compgen -- -W 'hpt,{1..4}/{1..8} hpt,{1..4}/{1..8}/{1..5}' ;; *) COMPREPLY=($(compgen -W "ata scsi sat usbcypress usbjmicron diff --git a/completions/tune2fs b/completions/tune2fs index 5bb02ff4e66..f2f472278d4 100644 --- a/completions/tune2fs +++ b/completions/tune2fs @@ -15,8 +15,7 @@ _comp_cmd_tune2fs() ;; -*g) _gids - ((${#COMPREPLY[@]})) && - _comp_compgen -- -g -W '"${COMPREPLY[@]}"' + _comp_compgen -a -- -g return ;; -*M) @@ -40,8 +39,7 @@ _comp_cmd_tune2fs() ;; -*u) _uids - ((${#COMPREPLY[@]})) && - _comp_compgen -- -u -W '"${COMPREPLY[@]}"' + _comp_compgen -a -- -u return ;; -*U) diff --git a/completions/useradd b/completions/useradd index f583f27568a..6822d8dd675 100644 --- a/completions/useradd +++ b/completions/useradd @@ -30,9 +30,7 @@ _comp_cmd_useradd() ;; --gid | -${noargopts}g) _gids - _comp_compgen -aR -- -g - ((${#COMPREPLY[@]})) && - _comp_compgen -- -W '"${COMPREPLY[@]}"' + _comp_compgen -a -- -g return ;; --groups | -${noargopts}G) diff --git a/completions/usermod b/completions/usermod index dee9404f681..ca925bf0faf 100644 --- a/completions/usermod +++ b/completions/usermod @@ -26,9 +26,7 @@ _comp_cmd_usermod() ;; --gid | -${noargopts}g) _gids - _comp_compgen -aR -- -g - ((${#COMPREPLY[@]})) && - _comp_compgen -- -W '"${COMPREPLY[@]}"' + _comp_compgen -a -- -g return ;; --groups | -${noargopts}G) From 48d9cc5ae29237ab4aabc596283d850c219be1bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Mon, 8 May 2023 07:09:05 +0900 Subject: [PATCH 14/15] fix(gnome-mplayer): fix wrong option -w for `compgen` --- completions/gnome-mplayer | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/completions/gnome-mplayer b/completions/gnome-mplayer index 269ddb87573..ed7b01f5f0d 100644 --- a/completions/gnome-mplayer +++ b/completions/gnome-mplayer @@ -10,7 +10,7 @@ _comp_cmd_gnome_mplayer() return ;; --showcontrols | --showsubtitles | --autostart) - _comp_compgen -- -w '0 1' + _comp_compgen -- -W '0 1' return ;; --subtitle) From 7e493070b92649b4e3922a6d05c3955de4c5dc04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Mon, 8 May 2023 07:09:41 +0900 Subject: [PATCH 15/15] fix(hping2): fix unfiltered option listing for `--tos` --- completions/hping2 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/completions/hping2 b/completions/hping2 index dcd390f7486..10b6e929173 100644 --- a/completions/hping2 +++ b/completions/hping2 @@ -17,7 +17,8 @@ _comp_cmd_hping2() return ;; --tos | -${noargopts}o) - _comp_compgen -R -- -W '02 04 08 10' + # TODO: parse choices from `--tos help`? + _comp_compgen -- -W '02 04 08 10' return ;; --file | -${noargopts}E)