From 9fbac9665654f37b5bb56d629be78b481b4b5485 Mon Sep 17 00:00:00 2001 From: roadscape <roadscape@users.noreply.github.com> Date: Thu, 15 Aug 2019 09:32:44 -0500 Subject: [PATCH] add path option to bin/grep --- bin/grep | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/bin/grep b/bin/grep index 3611a1594..a4f9736b7 100755 --- a/bin/grep +++ b/bin/grep @@ -1,2 +1,9 @@ #!/usr/bin/env bash -grep -rn $1 * --color=always --exclude-dir=docs/hive --exclude-dir=hivemind.egg-info | grep -v __pycache__ --color=auto + +if [ -z "$2" ] + then + grep -rn $1 * --color=always --exclude-dir=docs/hive --exclude-dir=hivemind.egg-info | grep -v __pycache__ --color=auto +else + grep -rn $1 $2 --color=always --exclude-dir=docs/hive --exclude-dir=hivemind.egg-info | grep -v __pycache__ --color=auto +fi + -- GitLab