Skip to content

Commit 9c3e196

Browse files
committed
fix: fix problems with set -o nounset
1 parent 7fba87c commit 9c3e196

File tree

5 files changed

+11
-8
lines changed

5 files changed

+11
-8
lines changed

bash_completion

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2455,7 +2455,9 @@ _comp__included_ssh_config_files()
24552455
# -p PREFIX Use PREFIX
24562456
# -4 Filter IPv6 addresses from results
24572457
# -6 Filter IPv4 addresses from results
2458-
# @return Completions, starting with CWORD, are added to COMPREPLY[]
2458+
# @var[out] COMPREPLY Completions, starting with CWORD, are added
2459+
# @return True (0) if one or more completions are generated, or otherwise False
2460+
# (1).
24592461
# @since 2.12
24602462
_comp_compgen_known_hosts()
24612463
{

completions/chromium-browser

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ _comp_cmd_chromium_browser()
1717
case $cur in
1818
*://*)
1919
local prefix="${cur%%://*}://"
20-
_comp_compgen_known_hosts -- "${cur#*://}"
21-
COMPREPLY=("${COMPREPLY[@]/#/$prefix}")
20+
_comp_compgen_known_hosts -- "${cur#*://}" &&
21+
COMPREPLY=("${COMPREPLY[@]/#/$prefix}")
2222
_comp_ltrim_colon_completions "$cur"
2323
;;
2424
*)

completions/cppcheck

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,9 @@ _comp_cmd_cppcheck()
2424
split="set"
2525
fi
2626
_comp_compgen -- -W 'all warning style performance portability
27-
information unusedFunction missingInclude'
28-
[[ $split ]] && COMPREPLY=(${COMPREPLY[@]/#/"$prev,"})
27+
information unusedFunction missingInclude' &&
28+
[[ $split ]] &&
29+
COMPREPLY=(${COMPREPLY[@]/#/"$prev,"})
2930
return
3031
;;
3132
--error-exitcode)

completions/cvs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ _comp_cmd_cvs__entries()
55
local prefix=${cur%/*}/ IFS=$'\n'
66
[[ -e ${prefix-}CVS/Entries ]] || prefix=""
77
entries=($(cut -d/ -f2 -s "${prefix-}CVS/Entries" 2>/dev/null))
8-
if [[ $entries ]]; then
8+
if ((${#entries[@]})); then
99
entries=("${entries[@]/#/${prefix-}}")
1010
compopt -o filenames
1111
fi

completions/smartctl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ _comp_cmd_smartctl__drivedb()
3535
prefix=+
3636
cur="${cur#+}"
3737
fi
38-
_comp_compgen_filedir h
39-
[[ $prefix ]] && COMPREPLY=("${COMPREPLY[@]/#/$prefix}")
38+
_comp_compgen_filedir h &&
39+
[[ $prefix ]] && COMPREPLY=("${COMPREPLY[@]/#/$prefix}")
4040
}
4141

4242
_comp_cmd_smartctl()

0 commit comments

Comments
 (0)