diff --git a/devops/find-file.sh b/devops/find-file.sh index 4d2634ae88c84d4c0caf8fd9fb85b85ef4f94601..0f52e0600a38b5e4ce7a8129e9e90f50fd57408b 100755 --- a/devops/find-file.sh +++ b/devops/find-file.sh @@ -19,15 +19,23 @@ Help() { # Display Help + echo "---------------------------------------------" echo "This script looks for occurences of files on finc instance branches. Usage: find-file.sh [file name]" - echo "Example: \"./devops/find-file.sh myresearch/edit.phtml\"" + echo "Example: \"./devops/find-file.sh myresearch/edit.phtml" + echo "---------------------------------------------" + echo "To find files CONTAINING a certain string set option c. Usage: find-file.sh -c [search string]" + echo "Example: \"./devops/find-file.sh -c loanHistoryAction" + echo "---------------------------------------------" } -while getopts ":h" option; do +while getopts ":ch" option; do case $option in - h) # display Help + h) echo "display Help..." Help exit;; + c) echo "looking for files containin a string..." + git branch --list *instance* | tr -d \* | tr -d '+'| xargs git grep $2 + exit;; \?) # incorrect option echo "Error: Invalid option" exit 1;