simple highlight

This commit is contained in:
Ville Rantanen
2019-11-18 12:59:23 +02:00
parent e2c16ea8d4
commit 1b6248733a

View File

@@ -28,6 +28,7 @@ Underline: $U
Usage: highbeam [-c] [-h] [-f config] Usage: highbeam [-c] [-h] [-f config]
-c Be case sensitive -c Be case sensitive
-D Print current rules, not the input -D Print current rules, not the input
-s Simple highlight a string (as argument)
-h Help -h Help
-f Define config file (default ~/.highbeamrc) -f Define config file (default ~/.highbeamrc)
-r Define rules with a string, replaces the other rules -r Define rules with a string, replaces the other rules
@@ -75,7 +76,7 @@ CONF_FILE=~/.highbeamrc
CONF_LINE="" CONF_LINE=""
FLAGS="ig" FLAGS="ig"
PRINT=0 PRINT=0
while getopts chf:r:D opt while getopts chf:r:s:D opt
do case "$opt" in do case "$opt" in
c) c)
FLAGS="g" FLAGS="g"
@@ -90,6 +91,10 @@ do case "$opt" in
r) r)
CONF_LINE=( $( eval echo $OPTARG ) ) CONF_LINE=( $( eval echo $OPTARG ) )
;; ;;
s)
HB_RULES='"'"$OPTARG"'" "$U$Y"' exec "$0"
exit $?
;;
D) D)
PRINT=1 PRINT=1
;; ;;