diff --git a/doc.zih.tu-dresden.de/util/grep-forbidden-words.sh b/doc.zih.tu-dresden.de/util/grep-forbidden-words.sh index c5f54b4c31d0f156213eeac9f6f9526cbcfa6d18..d3da672cfb4daf7820148c2d0a8d34ef1c8e5520 100755 --- a/doc.zih.tu-dresden.de/util/grep-forbidden-words.sh +++ b/doc.zih.tu-dresden.de/util/grep-forbidden-words.sh @@ -18,9 +18,9 @@ i file \+system HDFS i \<taurus\> taurus\.hrsk /taurus /TAURUS i \<hrskii\> i hpc[ -]\+da\> -i attachurl -i todo <!--.*--> -s \+$ +i ATTACHURL +i \<todo\> +i [[:space:]]$ i \(alpha\|ml\|haswell\|romeo\|gpu\|smp\|julia\|hpdlf\|scs5\)-\?\(interactive\)\?[^a-z]*partition i \[\s\?\(documentation\|here\|this \(link\|page\|subsection\)\|slides\?\|manpage\)\s\?\] i work[ -]\+space" @@ -48,13 +48,15 @@ function usage () { echo " -f Search in a specific markdown file" echo " -s Silent mode" echo " -h Show help message" + echo " -c Show git matches in color" } # Options all_files=false silent=false file="" -while getopts ":ahsf:" option; do +color="" +while getopts ":ahsf:c" option; do case $option in a) all_files=true @@ -66,6 +68,9 @@ while getopts ":ahsf:" option; do s) silent=true ;; + c) + color=" --color=always " + ;; h) usage exit;; @@ -108,7 +113,7 @@ for f in $files; do grepflag=-i ;; esac - if grep -n $grepflag "$pattern" "$f" | grepExceptions "${exceptionPatternsArray[@]}" ; then + if egrep -n $grepflag $color "$pattern" "$f" | grepExceptions "${exceptionPatternsArray[@]}" ; then ((cnt=cnt+1)) fi done <<< $exceptionPatterns