pacdiff: add --nocolor option for the terminally challenged.
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>
This commit is contained in:
parent
05e954d2cd
commit
b1b9ca01f0
1 changed files with 5 additions and 2 deletions
|
@ -29,8 +29,6 @@ declare -a oldsaves
|
||||||
|
|
||||||
m4_include(../scripts/library/output_format.sh)
|
m4_include(../scripts/library/output_format.sh)
|
||||||
|
|
||||||
m4_include(../scripts/library/term_colors.sh)
|
|
||||||
|
|
||||||
usage() {
|
usage() {
|
||||||
cat <<EOF
|
cat <<EOF
|
||||||
$myname is a simple pacnew/pacorig/pacsave updater.
|
$myname is a simple pacnew/pacorig/pacsave updater.
|
||||||
|
@ -39,6 +37,7 @@ Usage: $myname [-l]
|
||||||
|
|
||||||
Options:
|
Options:
|
||||||
-l/--locate scan using locate (default: find)
|
-l/--locate scan using locate (default: find)
|
||||||
|
--nocolor remove colors from output
|
||||||
|
|
||||||
Enviroment Variables:
|
Enviroment Variables:
|
||||||
DIFFPROG override the merge program: (default: vimdiff)
|
DIFFPROG override the merge program: (default: vimdiff)
|
||||||
|
@ -68,6 +67,8 @@ while [[ -n "$1" ]]; do
|
||||||
case "$1" in
|
case "$1" in
|
||||||
-l|--locate)
|
-l|--locate)
|
||||||
locate=1;;
|
locate=1;;
|
||||||
|
--nocolor)
|
||||||
|
USE_COLOR='n' ;;
|
||||||
-V|--version)
|
-V|--version)
|
||||||
version; exit 0;;
|
version; exit 0;;
|
||||||
-h|--help)
|
-h|--help)
|
||||||
|
@ -78,6 +79,8 @@ while [[ -n "$1" ]]; do
|
||||||
shift
|
shift
|
||||||
done
|
done
|
||||||
|
|
||||||
|
m4_include(../scripts/library/term_colors.sh)
|
||||||
|
|
||||||
# see http://mywiki.wooledge.org/BashFAQ/020
|
# see http://mywiki.wooledge.org/BashFAQ/020
|
||||||
while IFS= read -u 3 -r -d '' pacfile; do
|
while IFS= read -u 3 -r -d '' pacfile; do
|
||||||
file="${pacfile%.pac*}"
|
file="${pacfile%.pac*}"
|
||||||
|
|
Loading…
Add table
Reference in a new issue