[pacman-dev] [PATCH v4 5/8] bacman: add option to print fewer status updates

Gordian Edenhofer gordian.edenhofer at gmail.com
Thu Sep 1 13:43:20 UTC 2016


Signed-off-by: Gordian Edenhofer <gordian.edenhofer at gmail.com>
---
Switch to the native QUIET option of msg2().
Sorry for not using it in the first place.

 contrib/bacman.sh.in | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/contrib/bacman.sh.in b/contrib/bacman.sh.in
index 20f5939..0ae9da0 100644
--- a/contrib/bacman.sh.in
+++ b/contrib/bacman.sh.in
@@ -28,6 +28,7 @@ declare -r myname='bacman'
 declare -r myver='@PACKAGE_VERSION@'
 USE_COLOR='y'
 INCLUDE_PACNEW='n'
+QUIET=0
 # Required for fakeroot because options are shifted off the array.
 ARGS=("$@")
 
@@ -53,6 +54,7 @@ usage() {
 	Usage: $myname [options] <package(s)>
 
 	    -h, --help              display this help message and exit
+	    -q, --quiet             silence most of the status reporting
 	    --nocolor               turn off color in output
 	    --pacnew                package .pacnew files
 
@@ -85,8 +87,8 @@ for option in "$@"; do
 done
 
 # Parse arguments
-OPT_SHORT='v'
-OPT_LONG=('nocolor' 'pacnew' 'version')
+OPT_SHORT='qv'
+OPT_LONG=('quiet' 'nocolor' 'pacnew' 'version')
 if ! parseopts "$OPT_SHORT" "${OPT_LONG[@]}" -- "$@"; then
 	usage
 	exit 1
@@ -96,6 +98,8 @@ unset OPT_SHORT OPT_LONG OPTRET
 
 while :; do
 	case "$1" in
+		-q|--quiet)
+			QUIET=1 ;;
 		--nocolor)
 			USE_COLOR='n' ;;
 		--pacnew)
@@ -180,6 +184,7 @@ fakebuild() {
 
 	# Assemble list of files which belong to the package and tar them
 	msg2 "Copying package files..."
+
 	while read i; do
 		if [[ -z $i ]]; then
 			continue
-- 
2.9.3


More information about the pacman-dev mailing list