Skip to content

Commit 59a3b49

Browse files
committed
fix(puppet,valgrind): work around localvar_inherit
1 parent 1930f81 commit 59a3b49

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

completions/puppet

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ _comp_cmd_puppet()
6565
local cur prev words cword comp_args
6666
_comp_initialize -- "$@" || return
6767

68-
local subcommand action
68+
local subcommand="" action
6969

7070
case $prev in
7171
-h | --help | -V | --version)

completions/valgrind

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ _comp_cmd_valgrind()
1313
fi
1414
done
1515

16-
local word tool
16+
local word tool=""
1717
for word in "${words[@]:1}"; do
1818
if [[ $word == --tool=?* ]]; then
1919
tool=$word
@@ -70,7 +70,7 @@ _comp_cmd_valgrind()
7070
# generic cases parsed from --help output
7171
--+([-A-Za-z0-9_]))
7272
# shellcheck disable=SC2086
73-
local value=$("$1" --help-debug ${tool-} 2>/dev/null |
73+
local value=$("$1" --help-debug $tool 2>/dev/null |
7474
command sed \
7575
-ne "s|^[[:blank:]]*$prev=\([^[:blank:]]\{1,\}\).*|\1|p")
7676
case $value in
@@ -101,7 +101,7 @@ _comp_cmd_valgrind()
101101
[[ $was_split ]] && return
102102

103103
if [[ $cur == -* ]]; then
104-
COMPREPLY=($(compgen -W '$(_parse_help "$1" "--help ${tool-}")' \
104+
COMPREPLY=($(compgen -W '$(_parse_help "$1" "--help $tool")' \
105105
-- "$cur"))
106106
[[ ${COMPREPLY-} == *= ]] && compopt -o nospace
107107
return

0 commit comments

Comments
 (0)