diff rc/bashrc @ 524:51a60cc44880

Add hggrep to grep hg repo.
author edogawaconan <me@myconan.net>
date Wed, 09 Jul 2014 14:29:23 +0900
parents b88f621b6bd8
children 0ab0820fd528
line wrap: on
line diff
--- a/rc/bashrc	Tue Jul 08 23:56:18 2014 +0900
+++ b/rc/bashrc	Wed Jul 09 14:29:23 2014 +0900
@@ -177,6 +177,12 @@
   alias egrep="grep -E"
 fi
 
+# FIXME: missing test for hg and xargs -0
+_xargs_grep="${_grep}"
+[ "${_has_gnu_grep}" = y ] && _xargs_grep="${_grep} --color=always"
+alias hggrep="hg locate -0 | xargs -0 ${_xargs_grep}"
+unset _xargs_grep
+
 unset _has_gnu_ls
 unset _has_gnu_grep
 unset _has_posix_grep