dotfiles/.config/fish/functions/grep.fish

9 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