Skip to content

Commit b27c380

Browse files
committed
fix: work around localvar_inherit for [[ -v var ]]
1 parent cb78194 commit b27c380

36 files changed

+40
-1
lines changed

bash_completion

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -397,6 +397,7 @@ _comp_looks_like_path()
397397
__reassemble_comp_words_by_ref()
398398
{
399399
local exclude i j line ref
400+
unset -v exclude # workaround for localvar_inherit
400401
# Exclude word separator characters?
401402
if [[ $1 ]]; then
402403
# Yes, exclude word separator characters;
@@ -1885,6 +1886,7 @@ _known_hosts_real()
18851886
local configfile flag prefix=""
18861887
local cur suffix="" aliases i host ipv4 ipv6
18871888
local -a kh tmpkh=() khd=() config=()
1889+
unset -v configfile aliases ipv4 ipv6 # workaround for localvar_inherit
18881890

18891891
# TODO remove trailing %foo from entries
18901892

completions/_adb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ _comp_cmd_adb()
2626
esac
2727

2828
local cmd i
29+
unset -v cmd # workaround for localvar_inherit
2930
for ((i = 1; i < cword; i++)); do
3031
if [[ ${words[i]} != -* && ${words[i - 1]} != -[sp] ]]; then
3132
cmd="${words[i]}"

completions/_chsh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ _comp_cmd_chsh()
99
_comp_initialize -- "$@" || return
1010

1111
local word chroot
12+
unset -v chroot # workaround for localvar_inherit
1213
for word in "${words[@]}"; do
1314
if [[ -v chroot ]]; then
1415
chroot=$word

completions/_op

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ _comp_cmd_op()
3131
_comp_initialize -s -- "$@" || return
3232

3333
local command i
34+
unset -v command # workaround for localvar_inherit
3435
for ((i = 1; i < cword; i++)); do
3536
case ${words[i]} in
3637
--help | --version) return ;;

completions/_udevadm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ _comp_cmd_udevadm()
99
_comp_initialize -s -- "$@" || return
1010

1111
local i udevcmd
12+
unset -v udevcmd # workaround for localvar_inherit
1213
for ((i = 1; i < cword; i++)); do
1314
if [[ ${words[i]} != -* ]]; then
1415
udevcmd=${words[i]}

completions/_yum

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ _comp_cmd_yum()
4343
_comp_initialize -s -- "$@" || return
4444

4545
local special i
46+
unset -v special # workaround for localvar_inherit
4647
for ((i = 1; i < ${#words[@]} - 1; i++)); do
4748
if [[ ${words[i]} == @(install|update|upgrade|remove|erase|deplist|info) ]]; then
4849
special=${words[i]}

completions/apt-build

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ _apt_build()
66
_comp_initialize -- "$@" || return
77

88
local special i
9+
unset -v special # workaround for localvar_inherit
910
for ((i = 1; i < ${#words[@]} - 1; i++)); do
1011
if [[ ${words[i]} == @(install|remove|source|info|clean) ]]; then
1112
special=${words[i]}

completions/apt-cache

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ _apt_cache()
2929
_comp_initialize -- "$@" || return
3030

3131
local special ispecial
32+
unset -v special # workaround for localvar_inherit
3233
if [[ $cur != show ]]; then
3334
for ((ispecial = 1; ispecial < ${#words[@]} - 1; ispecial++)); do
3435
if [[ ${words[ispecial]} == @(add|depends|dotty|madison|policy|rdepends|show?(pkg|src|)) ]]; then

completions/apt-get

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ _apt_get()
2121
_comp_initialize -n ':=' -- "$@" || return
2222

2323
local special i
24+
unset -v special # workaround for localvar_inherit
2425
for ((i = 1; i < ${#words[@]} - 1; i++)); do
2526
if [[ ${words[i]} == @(install|remove|auto?(-)remove|purge|source|build-dep|download|changelog) ]]; then
2627
special=${words[i]}

completions/apt-mark

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ _comp_cmd_apt_mark()
66
_comp_initialize -s -- "$@" || return
77

88
local special i
9+
unset -v special # workaround for localvar_inherit
910
for ((i = 1; i < ${#words[@]} - 1; i++)); do
1011
if [[ ${words[i]} == @(auto|manual|minimize-manual|showauto|showmanual|hold|unhold|showhold|install|remove|deinstall|purge|showinstall|showremove|showpurge) ]]; then
1112
special=${words[i]}

0 commit comments

Comments
 (0)