10 lines
226 B
Fish
10 lines
226 B
Fish
|
function grep
|
||
|
if test "$pipestatus" = "0"
|
||
|
# No pipe before the grep
|
||
|
command grep -n --color=auto $argv
|
||
|
else
|
||
|
# There is a pipe before the grep
|
||
|
command grep --color=auto $argv
|
||
|
end
|
||
|
end
|