mirror of
https://github.com/moparisthebest/pacman
synced 2024-08-13 17:03:46 -04:00
scripts: Add color to pacman-key
Use --nocolor to suppress colored output from pacman-key, otherwise output will be in color. Signed-off-by: William Giokas <1007380@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
This commit is contained in:
parent
2c91b991ee
commit
9d99914a18
@ -77,6 +77,9 @@ Operations
|
|||||||
Locally sign the given key. This is primarily used to root the web of trust
|
Locally sign the given key. This is primarily used to root the web of trust
|
||||||
in the local private key generated by '\--init'.
|
in the local private key generated by '\--init'.
|
||||||
|
|
||||||
|
*\--nocolor*::
|
||||||
|
Disable colored output from pacman-key.
|
||||||
|
|
||||||
*-r, \--recv-keys*::
|
*-r, \--recv-keys*::
|
||||||
Equivalent to '\--recv-keys' in GnuPG.
|
Equivalent to '\--recv-keys' in GnuPG.
|
||||||
|
|
||||||
|
@ -43,6 +43,7 @@ POPULATE=0
|
|||||||
RECEIVE=0
|
RECEIVE=0
|
||||||
REFRESH=0
|
REFRESH=0
|
||||||
UPDATEDB=0
|
UPDATEDB=0
|
||||||
|
USE_COLOR='y'
|
||||||
VERIFY=0
|
VERIFY=0
|
||||||
|
|
||||||
DEFAULT_KEYSERVER='hkp://pool.sks-keyservers.net'
|
DEFAULT_KEYSERVER='hkp://pool.sks-keyservers.net'
|
||||||
@ -514,7 +515,7 @@ fi
|
|||||||
OPT_SHORT="adefhlruvV"
|
OPT_SHORT="adefhlruvV"
|
||||||
OPT_LONG=('add' 'config:' 'delete' 'edit-key' 'export' 'finger' 'gpgdir:'
|
OPT_LONG=('add' 'config:' 'delete' 'edit-key' 'export' 'finger' 'gpgdir:'
|
||||||
'help' 'import' 'import-trustdb' 'init' 'keyserver:' 'list-keys' 'list-sigs'
|
'help' 'import' 'import-trustdb' 'init' 'keyserver:' 'list-keys' 'list-sigs'
|
||||||
'lsign-key' 'populate' 'recv-keys' 'refresh-keys' 'updatedb'
|
'lsign-key' 'nocolor' 'populate' 'recv-keys' 'refresh-keys' 'updatedb'
|
||||||
'verify' 'version')
|
'verify' 'version')
|
||||||
if ! parseopts "$OPT_SHORT" "${OPT_LONG[@]}" -- "$@"; then
|
if ! parseopts "$OPT_SHORT" "${OPT_LONG[@]}" -- "$@"; then
|
||||||
exit 1 # E_INVALID_OPTION;
|
exit 1 # E_INVALID_OPTION;
|
||||||
@ -543,6 +544,7 @@ while (( $# )); do
|
|||||||
-l|--list-keys) LISTKEYS=1 ;;
|
-l|--list-keys) LISTKEYS=1 ;;
|
||||||
--list-sigs) LISTSIGS=1 ;;
|
--list-sigs) LISTSIGS=1 ;;
|
||||||
--lsign-key) LSIGNKEY=1 UPDATEDB=1 ;;
|
--lsign-key) LSIGNKEY=1 UPDATEDB=1 ;;
|
||||||
|
--nocolor) USE_COLOR='n';;
|
||||||
--populate) POPULATE=1 UPDATEDB=1 ;;
|
--populate) POPULATE=1 UPDATEDB=1 ;;
|
||||||
-r|--recv-keys) RECEIVE=1 UPDATEDB=1 ;;
|
-r|--recv-keys) RECEIVE=1 UPDATEDB=1 ;;
|
||||||
--refresh-keys) REFRESH=1 ;;
|
--refresh-keys) REFRESH=1 ;;
|
||||||
@ -557,6 +559,7 @@ while (( $# )); do
|
|||||||
shift
|
shift
|
||||||
done
|
done
|
||||||
|
|
||||||
|
m4_include(library/term_colors.sh)
|
||||||
|
|
||||||
if ! type -p gpg >/dev/null; then
|
if ! type -p gpg >/dev/null; then
|
||||||
error "$(gettext "Cannot find the %s binary required for all %s operations.")" "gpg" "pacman-key"
|
error "$(gettext "Cannot find the %s binary required for all %s operations.")" "gpg" "pacman-key"
|
||||||
|
Loading…
Reference in New Issue
Block a user