]> wolfpit.net Git - tool/Arch-pacman/.git/commitdiff
pacdiff: add --nocolor option for the terminally challenged.
authorJonathan Frazier <eyeswide@gmail.com>
Mon, 15 Jul 2013 17:02:33 +0000 (13:02 -0400)
committerAllan McRae <allan@archlinux.org>
Tue, 30 Jul 2013 03:00:10 +0000 (13:00 +1000)
Allow colors to be disabled for use on broken/serial terminals.

Signed-off-by: Jonathan Frazier <eyeswide@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
contrib/pacdiff.sh.in

index ce7de5292d9f09b54c9506943038d60e2928a6d9..a64be4ce895eafcc6e3b7591aecf54485bbc869e 100644 (file)
@@ -29,8 +29,6 @@ declare -a oldsaves
 
 m4_include(../scripts/library/output_format.sh)
 
-m4_include(../scripts/library/term_colors.sh)
-
 usage() {
        cat <<EOF
 $myname is a simple pacnew/pacorig/pacsave updater.
@@ -39,6 +37,7 @@ Usage: $myname [-l]
 
 Options:
   -l/--locate       scan using locate (default: find)
+  --nocolor         remove colors from output
 
 Enviroment Variables:
   DIFFPROG          override the merge program: (default: vimdiff)
@@ -68,6 +67,8 @@ while [[ -n "$1" ]]; do
        case "$1" in
                -l|--locate)
                locate=1;;
+               --nocolor)
+               USE_COLOR='n' ;;
                -V|--version)
                version; exit 0;;
                -h|--help)
@@ -78,6 +79,8 @@ while [[ -n "$1" ]]; do
        shift
 done
 
+m4_include(../scripts/library/term_colors.sh)
+
 # see http://mywiki.wooledge.org/BashFAQ/020
 while IFS= read -u 3 -r -d '' pacfile; do
        file="${pacfile%.pac*}"