From d02a150884491370cd16c77907dd5d2ea576cb7d Mon Sep 17 00:00:00 2001 From: Josh Holtrop Date: Fri, 4 Mar 2011 12:32:12 -0500 Subject: [PATCH 1/2] take an optional target directory argument --- grepdefine | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/grepdefine b/grepdefine index 15584aa..3e8e72d 100755 --- a/grepdefine +++ b/grepdefine @@ -1,4 +1,8 @@ -#!/bin/sh +#!/bin/bash define="$1" -exec grep --exclude-dir .svn --color=auto -R "define *\\<${define}\\>" . +where="$2" +if [[ "x$where" == "x" ]]; then + where=. +fi +exec grep --exclude-dir .svn --color=auto -R "define *\\<${define}\\>" ${where} From 673d209206df094fbd7ba01a42ebebca7a23784c Mon Sep 17 00:00:00 2001 From: Josh Holtrop Date: Fri, 4 Mar 2011 12:32:56 -0500 Subject: [PATCH 2/2] ignore binary files --- grepdefine | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/grepdefine b/grepdefine index 3e8e72d..a5cf750 100755 --- a/grepdefine +++ b/grepdefine @@ -5,4 +5,4 @@ where="$2" if [[ "x$where" == "x" ]]; then where=. fi -exec grep --exclude-dir .svn --color=auto -R "define *\\<${define}\\>" ${where} +exec grep --exclude-dir .svn --color=auto -RI "define *\\<${define}\\>" ${where}