Skip to content

Commit 4de260e

Browse files
authored
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 <[email protected]> Signed-off-by: Derek Schrock <[email protected]> Closes #16234
1 parent b558f0a commit 4de260e

File tree

1 file changed

+1
-1
lines changed
  • contrib/bash_completion.d

1 file changed

+1
-1
lines changed

contrib/bash_completion.d/zfs.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ __zfs_list_volumes()
155155
__zfs_argument_chosen()
156156
{
157157
local word property
158-
for word in $(seq $((COMP_CWORD-1)) -1 2)
158+
for word in $(seq $((COMP_CWORD-1)) -1 2 2>/dev/null)
159159
do
160160
local prev="${COMP_WORDS[$word]}"
161161
if [[ ${COMP_WORDS[$word-1]} != -[tos] ]]

0 commit comments

Comments
 (0)