Skip to content

Commit 96ac410

Browse files
committed
fix(_parse_{help,usage}): avoid command_not_found_handle
1 parent 3e4ec08 commit 96ac410

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

bash_completion

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1112,7 +1112,7 @@ _parse_help()
11121112
(
11131113
case $cmd in
11141114
-) exec cat ;;
1115-
*) _comp_dequote "$cmd" && LC_ALL=C "$ret" ${2:---help} 2>&1 ;;
1115+
*) _comp_dequote "$cmd" && type -- "$ret" &>/dev/null && LC_ALL=C "$ret" ${2:---help} 2>&1 ;;
11161116
esac
11171117
) |
11181118
while read -r line; do
@@ -1149,7 +1149,7 @@ _parse_usage()
11491149
(
11501150
case $cmd in
11511151
-) exec cat ;;
1152-
*) _comp_dequote "$cmd" && LC_ALL=C "$ret" ${2:---usage} 2>&1 ;;
1152+
*) _comp_dequote "$cmd" && type -- "$ret" &>/dev/null && LC_ALL=C "$ret" ${2:---usage} 2>&1 ;;
11531153
esac
11541154
) |
11551155
while read -r line; do

0 commit comments

Comments
 (0)