mirror of
https://github.com/moparisthebest/pacman
synced 2024-08-13 17:03:46 -04:00
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>
This commit is contained in:
parent
65650f2cdb
commit
2c91b991ee
@ -28,11 +28,13 @@ declare -r myver='@PACKAGE_VERSION@'
|
|||||||
eval $(awk '/DBPath/ {print $1$2$3}' @sysconfdir@/pacman.conf)
|
eval $(awk '/DBPath/ {print $1$2$3}' @sysconfdir@/pacman.conf)
|
||||||
dbroot="${DBPath:-@localstatedir@/lib/pacman/}"
|
dbroot="${DBPath:-@localstatedir@/lib/pacman/}"
|
||||||
|
|
||||||
|
USE_COLOR='y'
|
||||||
|
|
||||||
m4_include(library/output_format.sh)
|
m4_include(library/output_format.sh)
|
||||||
|
|
||||||
usage() {
|
usage() {
|
||||||
printf "pacman-db-upgrade (pacman) %s\n\n" "$myver"
|
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() {
|
version() {
|
||||||
@ -72,6 +74,13 @@ if [[ $1 = "-V" || $1 = "--version" ]]; then
|
|||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [[ $1 = "--nocolor" ]]; then
|
||||||
|
USE_COLOR='n'
|
||||||
|
shift
|
||||||
|
fi
|
||||||
|
|
||||||
|
m4_include(library/term_colors.sh)
|
||||||
|
|
||||||
if [[ -n $1 ]]; then
|
if [[ -n $1 ]]; then
|
||||||
dbroot="$1"
|
dbroot="$1"
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user