aboutsummaryrefslogtreecommitdiffhomepage
path: root/share/functions/seq.fish
diff options
context:
space:
mode:
Diffstat (limited to 'share/functions/seq.fish')
-rw-r--r--share/functions/seq.fish6
1 files changed, 3 insertions, 3 deletions
diff --git a/share/functions/seq.fish b/share/functions/seq.fish
index f710c235..4229f0c5 100644
--- a/share/functions/seq.fish
+++ b/share/functions/seq.fish
@@ -2,7 +2,7 @@
# test -x in /usr/bin/seq because that's where it usually is and
# that's substantially cheaper than the type function
-if begin ; not test -x /usr/bin/seq ; and not type -f seq > /dev/null; end
+if begin ; not test -x /usr/bin/seq ; and not type -q -f seq; end
# No seq command
function seq --description "Print sequences of numbers"
__fish_fallback_seq $argv
@@ -29,14 +29,14 @@ if begin ; not test -x /usr/bin/seq ; and not type -f seq > /dev/null; end
case '*'
printf (_ "%s: Expected 1, 2 or 3 arguments, got %d\n") seq (count $argv)
- exit 1
+ return 1
end
for i in $from $step $to
if not echo $i | grep -E '^-?[0-9]*([0-9]*|\.[0-9]+)$' >/dev/null
printf (_ "%s: '%s' is not a number\n") seq $i
- exit 1
+ return 1
end
end