diff options
author | wanderer <wanderer@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2005-12-07 18:11:58 +0000 |
---|---|---|
committer | wanderer <wanderer@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2005-12-07 18:11:58 +0000 |
commit | ec58ad4075bffe7c575e1f64b1af343bac22d2b8 (patch) | |
tree | 4fd88f8286dff5bdc4deb22b97d7df6d2a4be9be /TOOLS | |
parent | af02a1574efaf960e47aa66bd94dddb61924294b (diff) | |
download | mpv-ec58ad4075bffe7c575e1f64b1af343bac22d2b8.tar.bz2 mpv-ec58ad4075bffe7c575e1f64b1af343bac22d2b8.tar.xz |
option to show the lines containing anomalies, patch by Ivo van Poorten
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@17132 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'TOOLS')
-rwxr-xr-x | TOOLS/checktree.sh | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/TOOLS/checktree.sh b/TOOLS/checktree.sh index eff1fa5b07..07a473dacb 100755 --- a/TOOLS/checktree.sh +++ b/TOOLS/checktree.sh @@ -22,6 +22,7 @@ _crlf=yes _trailws=no _rcsid=no _oll=no +_showcont=no _color=yes _head=yes @@ -103,6 +104,9 @@ for i in "$@"; do echo printoption "all " "enable all tests" "no" echo + printoption "showcont " "show offending content of file(s)" \ + "$_showcont" + echo printoption "color " "colored output" "$_color" printoption "head " "print heading for each test" "$_head" printoption "cvs " "use CVS/ to determine which files to check" \ @@ -174,6 +178,12 @@ for i in "$@"; do -none) disable_all_tests ;; + -showcont) + _showcont=yes + ;; + -noshowcont) + _showcont=no + ;; -*) echo "unknown option: $i" >&2 exit 0 @@ -222,15 +232,24 @@ fi if [ "$_crlf" == "yes" ]; then printhead "checking for MSDOS line endings ..." + if [ "$_showcont" == "yes" ]; then + grep -n -I " +" $filelist + else grep -l -I " " $filelist + fi fi # ----------------------------------------------------------------------------- if [ "$_trailws" == "yes" ]; then printhead "checking for trailing whitespace ..." + if [ "$_showcont" == "yes" ]; then + grep -n -I "[[:space:]]\+$" $filelist + else grep -l -I "[[:space:]]\+$" $filelist + fi fi # ----------------------------------------------------------------------------- @@ -244,7 +263,11 @@ fi if [ "$_oll" == "yes" ]; then printhead "checking for overly long lines (over 79 characters) ..." + if [ "$_showcont" == "yes" ]; then + grep -n -I "^[[:print:]]\{80,\}$" $filelist + else grep -l -I "^[[:print:]]\{80,\}$" $filelist + fi fi # ----------------------------------------------------------------------------- |