summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorWilliam Giokas <1007380@gmail.com>2013-03-04 09:19:33 +0100
committerAllan McRae <allan@archlinux.org>2013-03-08 08:04:39 +0100
commit2c91b991eee2c16278111f922ba974857e1ae9cd (patch)
treeeff69019b92fb9dd1d246863cf0a8402688a6b9d /scripts
parent65650f2cdb04629810cb7545e35ad8af9e25b072 (diff)
downloadpacman-2c91b991eee2c16278111f922ba974857e1ae9cd.tar.gz
pacman-2c91b991eee2c16278111f922ba974857e1ae9cd.tar.xz
scripts: Add color to pacman-db-upgrade
Color enabled by default, use --nocolor to turn off colors. Signed-off-by: William Giokas <1007380@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/pacman-db-upgrade.sh.in11
1 files changed, 10 insertions, 1 deletions
diff --git a/scripts/pacman-db-upgrade.sh.in b/scripts/pacman-db-upgrade.sh.in
index 1b5407a4..a1630c52 100644
--- a/scripts/pacman-db-upgrade.sh.in
+++ b/scripts/pacman-db-upgrade.sh.in
@@ -28,11 +28,13 @@ declare -r myver='@PACKAGE_VERSION@'
eval $(awk '/DBPath/ {print $1$2$3}' @sysconfdir@/pacman.conf)
dbroot="${DBPath:-@localstatedir@/lib/pacman/}"
+USE_COLOR='y'
+
m4_include(library/output_format.sh)
usage() {
printf "pacman-db-upgrade (pacman) %s\n\n" "$myver"
- printf -- "$(gettext "Usage: %s [pacman_db_root]")\n\n" "$0"
+ printf -- "$(gettext "Usage: %s [--nocolor] [pacman_db_root]")\n\n" "$0"
}
version() {
@@ -72,6 +74,13 @@ if [[ $1 = "-V" || $1 = "--version" ]]; then
exit 0
fi
+if [[ $1 = "--nocolor" ]]; then
+ USE_COLOR='n'
+ shift
+fi
+
+m4_include(library/term_colors.sh)
+
if [[ -n $1 ]]; then
dbroot="$1"
fi