scripts: Add color to pacman-optimize
Color enabled by default, use --nocolor to disable colored output. Signed-off-by: William Giokas <1007380@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
This commit is contained in:
parent
9d99914a18
commit
81f945e2a5
|
@ -24,6 +24,8 @@
|
|||
export TEXTDOMAIN='pacman-scripts'
|
||||
export TEXTDOMAINDIR='@localedir@'
|
||||
|
||||
USE_COLOR='y'
|
||||
|
||||
declare -r myver='@PACKAGE_VERSION@'
|
||||
|
||||
eval $(awk '/DBPath/ {print $1$2$3}' @sysconfdir@/pacman.conf)
|
||||
|
@ -33,7 +35,7 @@ m4_include(library/output_format.sh)
|
|||
|
||||
usage() {
|
||||
printf "pacman-optimize (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"
|
||||
printf -- "$(gettext "\
|
||||
pacman-optimize is a little hack that should improve the performance\n\
|
||||
of pacman when reading/writing to its filesystem-based database.\n\n")"
|
||||
|
@ -84,6 +86,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
|
||||
|
|
Loading…
Reference in New Issue