1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-11-28 08:02:54 +00:00

contrib/bash_completion.d: squelch FreeBSD seq when first < last

With seq x -1 z and x is less than z FreeBSD seq will print the error:

	$ seq 1 -1 2
	seq: needs positive increment

Hide this error.  Alternatively $COMP_CWORD could be checked for < 2.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Derek Schrock <dereks@lifeofadishwasher.com>
Closes #16234
This commit is contained in:
Derek Schrock 2024-06-06 20:37:26 -04:00 committed by GitHub
parent b558f0a9d6
commit 4de260efe3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -155,7 +155,7 @@ __zfs_list_volumes()
__zfs_argument_chosen()
{
local word property
for word in $(seq $((COMP_CWORD-1)) -1 2)
for word in $(seq $((COMP_CWORD-1)) -1 2 2>/dev/null)
do
local prev="${COMP_WORDS[$word]}"
if [[ ${COMP_WORDS[$word-1]} != -[tos] ]]