Skip to content

Commit 6e9249a

Browse files
committed
feat(_comp_compgen_known_hosts): return 2 on usage error
1 parent 809a1da commit 6e9249a

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
@@ -2409,7 +2409,7 @@ _comp_compgen_known_hosts__impl()
24092409
F)
24102410
if [[ ! $OPTARG ]]; then
24112411
echo "bash_completion: $FUNCNAME: -F: an empty filename is specified" >&2
2412-
return 1
2412+
return 2
24132413
fi
24142414
configfile=$OPTARG
24152415
;;
@@ -2418,13 +2418,13 @@ _comp_compgen_known_hosts__impl()
24182418
6) ipv6=set ;;
24192419
*)
24202420
echo "bash_completion: $FUNCNAME: usage error" >&2
2421-
return 1
2421+
return 2
24222422
;;
24232423
esac
24242424
done
24252425
if (($# < OPTIND)); then
24262426
echo "bash_completion: $FUNCNAME: missing mandatory argument CWORD" >&2
2427-
return 1
2427+
return 2
24282428
fi
24292429
cur=${!OPTIND}
24302430
((OPTIND += 1))
@@ -2434,7 +2434,7 @@ _comp_compgen_known_hosts__impl()
24342434
printf '%s ' ${!OPTIND}
24352435
shift
24362436
done)" >&2
2437-
return 1
2437+
return 2
24382438
fi
24392439

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

0 commit comments

Comments
 (0)