Skip to content

Commit 3a9d972

Browse files
committed
feat(_comp_compgen_known_hosts): return 2 on usage error
1 parent 42f0a5d commit 3a9d972

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

bash_completion

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2421,7 +2421,7 @@ _comp_compgen_known_hosts__impl()
24212421
F)
24222422
if [[ ! $OPTARG ]]; then
24232423
echo "bash_completion: $FUNCNAME: -F: an empty filename is specified" >&2
2424-
return 1
2424+
return 2
24252425
fi
24262426
configfile=$OPTARG
24272427
;;
@@ -2430,13 +2430,13 @@ _comp_compgen_known_hosts__impl()
24302430
6) ipv6=set ;;
24312431
*)
24322432
echo "bash_completion: $FUNCNAME: usage error" >&2
2433-
return 1
2433+
return 2
24342434
;;
24352435
esac
24362436
done
24372437
if (($# < OPTIND)); then
24382438
echo "bash_completion: $FUNCNAME: missing mandatory argument CWORD" >&2
2439-
return 1
2439+
return 2
24402440
fi
24412441
cur=${!OPTIND}
24422442
((OPTIND += 1))
@@ -2446,7 +2446,7 @@ _comp_compgen_known_hosts__impl()
24462446
printf '%s ' ${!OPTIND}
24472447
shift
24482448
done)" >&2
2449-
return 1
2449+
return 2
24502450
fi
24512451

24522452
[[ $cur == *@* ]] && prefix=$prefix${cur%@*}@ && cur=${cur#*@}

0 commit comments

Comments
 (0)