diff options
author | William Giokas <1007380@gmail.com> | 2013-03-04 02:29:50 -0600 |
---|---|---|
committer | Allan McRae <allan@archlinux.org> | 2013-03-08 17:04:39 +1000 |
commit | 79d60f0f42a1df4f65ef1b1a930a6107000570fe (patch) | |
tree | 8433f40506463779d05f7412dbcc32ae22d231c6 /scripts/pkgdelta.sh.in | |
parent | 81f945e2a5cee7995bb8521da5bad0ae91eb4aec (diff) | |
download | pacman-79d60f0f42a1df4f65ef1b1a930a6107000570fe.tar.xz |
scripts: Add color to pkgdelta
Signed-off-by: William Giokas <1007380@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
Diffstat (limited to 'scripts/pkgdelta.sh.in')
-rw-r--r-- | scripts/pkgdelta.sh.in | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/scripts/pkgdelta.sh.in b/scripts/pkgdelta.sh.in index f9b40c96..a6aad3f6 100644 --- a/scripts/pkgdelta.sh.in +++ b/scripts/pkgdelta.sh.in @@ -29,6 +29,7 @@ export TEXTDOMAINDIR='@localedir@' declare -r myver='@PACKAGE_VERSION@' QUIET=0 +USE_COLOR='y' # minimal of package before deltas are generated (bytes) min_pkg_size=$((1024*1024)) @@ -54,6 +55,7 @@ This delta file can then be added to a database using repo-add.\n\n")" echo printf -- "$(gettext "Options:\n")" printf -- "$(gettext " -q, --quiet minimize output\n")" + printf -- "$(gettext " --nocolor remove color from output\n")" printf -- "$(gettext " --min-pkg-size minimum package size before deltas are generated\n")" printf -- "$(gettext " --max-delta-size percent of new package above which the delta will be discarded\n")" } @@ -155,7 +157,7 @@ create_xdelta() } OPT_SHORT='hqV' -OPT_LONG=('help' 'quiet' 'max-delta-size:' 'min-pkg-size:' 'version') +OPT_LONG=('help' 'quiet' 'max-delta-size:' 'min-pkg-size:' 'nocolor' 'version') if ! parseopts "$OPT_SHORT" "${OPT_LONG[@]}" -- "$@"; then exit 1 fi @@ -173,6 +175,8 @@ while :; do exit 0 ;; -q|--quiet) QUIET=1;; + --nocolor) + USE_COLOR='n';; --min-pkg-size) if ! min_pkg_size=$(human_to_size "$2"); then echo "invalid argument '$2' for option -- '$1'" @@ -194,6 +198,8 @@ while :; do shift done +m4_include(library/term_colors.sh) + if (( $# != 2 )); then usage exit 1 |