Skip to content

Commit

Permalink
contrib/bash_completion.d: squelch FreeBSD seq when first < last
Browse files Browse the repository at this point in the history
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 openzfs#16234
  • Loading branch information
derekschrock authored and tonyhutter committed Nov 6, 2024
1 parent d3887c4 commit 5dac614
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion contrib/bash_completion.d/zfs.in
Original file line number Diff line number Diff line change
@@ -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] ]]

0 comments on commit 5dac614

Please sign in to comment.