[pacman-dev] [PATCH v7 08/12] bacman: add option to print fewer status updates

Gordian Edenhofer gordian.edenhofer at gmail.com
Sat Sep 3 16:53:05 UTC 2016


Signed-off-by: Gordian Edenhofer <gordian.edenhofer at gmail.com>
---
Move indentation fixes into its own commit.

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

diff --git a/contrib/bacman.sh.in b/contrib/bacman.sh.in
index 6f943a1..94b09d7 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=("$@")
 
@@ -54,6 +55,7 @@ usage() {
 	echo
 	printf -- "$(gettext "Options:")\n"
 	printf -- "$(gettext "  -h, --help       Show this help message and exit")\n"
+	printf -- "$(gettext "  -q, --quiet      Silence most of the status reporting")\n"
 	printf -- "$(gettext "  -m, --nocolor    Disable colorized output messages")\n"
 	printf -- "$(gettext "  --pacnew         Package .pacnew files")\n"
 	echo
@@ -85,8 +87,8 @@ for option in "$@"; do
 done
 
 # Parse arguments
-OPT_SHORT='mv'
-OPT_LONG=('nocolor' 'pacnew' 'version')
+OPT_SHORT='qmv'
+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 ;;
 		-m|--nocolor)
 			USE_COLOR='n' ;;
 		--pacnew)
-- 
2.9.3


More information about the pacman-dev mailing list