diff options
Diffstat (limited to 'scripts/pacman-key.sh.in')
-rw-r--r-- | scripts/pacman-key.sh.in | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/scripts/pacman-key.sh.in b/scripts/pacman-key.sh.in index 1d26f44c..66336e9a 100644 --- a/scripts/pacman-key.sh.in +++ b/scripts/pacman-key.sh.in @@ -28,7 +28,8 @@ declare -r myver="@PACKAGE_VERSION@" LIBRARY=${LIBRARY:-'@libmakepkgdir@'} -# Import parseopts.sh +# Import libmakepkg +source "$LIBRARY"/util/message.sh source "$LIBRARY"/util/parseopts.sh # Options @@ -51,8 +52,6 @@ UPDATEDB=0 USE_COLOR='y' VERIFY=0 -m4_include(library/output_format.sh) - usage() { printf "pacman-key (pacman) %s\n" ${myver} echo @@ -563,7 +562,12 @@ while (( $# )); do shift done -m4_include(library/term_colors.sh) +# check if messages are to be printed using color +if [[ -t 2 && $USE_COLOR != "n" ]]; then + colorize +else + unset ALL_OFF BOLD BLUE GREEN RED YELLOW +fi if ! type -p gpg >/dev/null; then error "$(gettext "Cannot find the %s binary required for all %s operations.")" "gpg" "pacman-key" |