notegrep: Check for invalid input including parameters
This commit is contained in:
parent
6540ec4e49
commit
54276bc1d2
1 changed files with 6 additions and 0 deletions
|
@ -132,6 +132,9 @@ function notegrep() {
|
||||||
;;
|
;;
|
||||||
-sl | --show-lines )
|
-sl | --show-lines )
|
||||||
. ~/.shellnotes/util/notegrep/sl.sh
|
. ~/.shellnotes/util/notegrep/sl.sh
|
||||||
|
;;
|
||||||
|
-ws | --without-string )
|
||||||
|
. ~/.shellnotes/util/notegrep/ws.sh
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
echo "Invalid parameter. Proceeding in normal grep mode."
|
echo "Invalid parameter. Proceeding in normal grep mode."
|
||||||
|
@ -171,6 +174,9 @@ function notegrep() {
|
||||||
export option=$1
|
export option=$1
|
||||||
. ~/.shellnotes/util/notegrep/sf.sh
|
. ~/.shellnotes/util/notegrep/sf.sh
|
||||||
;;
|
;;
|
||||||
|
-sc | --split-char | -cl | --count-lines | -sf | --show-lines | -ws | --without-string)
|
||||||
|
echo "Invalid use of parameter '$regex'.\nUsage:\nnotegrep [PATTERN] file...\nnotegrep [OPTION] [PATTERN] file...\nnotegrep [OPTION] file...\nnotegrep [OPTION] [PATTERN]"
|
||||||
|
;;
|
||||||
*)
|
*)
|
||||||
if [ -z $notename ]; then
|
if [ -z $notename ]; then
|
||||||
echo "Invalid input."
|
echo "Invalid input."
|
||||||
|
|
Loading…
Reference in a new issue