From 8d0eae5c7faec219d85829e1d8b9a11267c1602a Mon Sep 17 00:00:00 2001 From: LeeW Date: Thu, 17 Sep 2015 21:32:10 +0800 Subject: [PATCH] Add warning when there is not argument after search, append and export --- bin/git-ignore-io | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/bin/git-ignore-io b/bin/git-ignore-io index 86ad885..889f9f4 100755 --- a/bin/git-ignore-io +++ b/bin/git-ignore-io @@ -86,6 +86,8 @@ else opt=$1 shift if [[ $# -eq 0 ]]; then + echo "There should be at least one type!!!" + echo show_usage exit fi @@ -108,7 +110,15 @@ else -u|--update-list) update_gi_list ;; - -s|--search) + -s|--search) + opt=$1 + shift + if [[ $# -eq 0 ]]; then + echo "There should be one word to be searched!!!" + echo + show_usage + exit + fi search "$2" ;; -L|--list-alphabetically)