mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-26 12:53:13 +00:00
seq.fish: use gseq if available.
Apparently if you install gnu coreutils on OpenBSD, the tools are g-prefixed. So we definitely want to just alias that rather than provide our lousy shell script implementation.
This commit is contained in:
parent
ba1249763b
commit
eaf496c1d4
1 changed files with 12 additions and 4 deletions
|
@ -1,10 +1,18 @@
|
||||||
# If seq is not installed, then define a function that invokes __fish_fallback_seq
|
# If seq is not installed, then define a function that invokes __fish_fallback_seq
|
||||||
# We can't call type here because that also calls seq
|
# We can't call type here because that also calls seq
|
||||||
|
|
||||||
if not command -sq seq
|
if not command -sq seq
|
||||||
# No seq command
|
if command -sq gseq
|
||||||
function seq --description "Print sequences of numbers"
|
# No seq provided by the OS, but GNU coreutils was apparently installed, fantastic
|
||||||
__fish_fallback_seq $argv
|
function seq --description "Print sequences of numbers (gseq)"
|
||||||
|
gseq $argv
|
||||||
|
end
|
||||||
|
exit
|
||||||
|
else
|
||||||
|
# No seq command
|
||||||
|
function seq --description "Print sequences of numbers"
|
||||||
|
__fish_fallback_seq $argv
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function __fish_fallback_seq --description "Fallback implementation of the seq command"
|
function __fish_fallback_seq --description "Fallback implementation of the seq command"
|
||||||
|
|
Loading…
Reference in a new issue