summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xbin/pkg15
-rw-r--r--man/5/pkg.conf10
2 files changed, 23 insertions, 2 deletions
diff --git a/bin/pkg b/bin/pkg
index d45c05b..d3a5bb4 100755
--- a/bin/pkg
+++ b/bin/pkg
@@ -54,6 +54,8 @@ if [[ -r $XDG_CONFIG_HOME/pkg/pkg.conf ]] {
# Parse commandline options
while [[ $1 == --* ]] {
case $1 in
+ --coluors) COLOURS=1 ;;
+ --no-colours) COLOURS=0 ;;
--quiet) SILENT=1 ;;
--no-quiiet) SILENT=0 ;;
--debug) DEBUG=1 ;;
@@ -63,6 +65,8 @@ while [[ $1 == --* ]] {
--checklinks-options) CL_OPTIONS+=$2; shift ;;
--packagedir) PKG_DIR=$2; shift ;;
--packageroot) PKG_ROOT=$2; shift ;;
+ --progress) PROGRESS=1 ;;
+ --no-progress) PROGRESS=0 ;;
*) die "Unknown argument: '$1'\n" ;;
esac
shift
@@ -78,6 +82,8 @@ shift
: ${DEBUG=0}
: ${AUTOUPDATE=1}
: ${GIT_USE_ORIGIN=1}
+: ${COLOURS=1}
+: ${PROGRESS=1}
export PKG_DIR
export PKG_ROOT
@@ -108,6 +114,13 @@ if (( SILENT )) {
function info {}
function say {}
function clear_line {}
+ PROGRESS=0
+}
+
+if (( !COLOURS )) {
+ c_info=''
+ c_reset=''
+ c_error=''
}
if [[ ! -d $PKG_DIR ]] {
@@ -195,7 +208,7 @@ function confirm_no {
function wrap_info {}
function progress {
- (( SILENT )) && return
+ ((PROGRESS)) || return
typeset -i current=$1
typeset -i max=$2
typeset desc=$3
diff --git a/man/5/pkg.conf b/man/5/pkg.conf
index cfa1c9f..9bb918a 100644
--- a/man/5/pkg.conf
+++ b/man/5/pkg.conf
@@ -42,9 +42,17 @@ path for the local package tree
Options to invoke L<checklinks>(1) with
+=item B<COLOURS>=I<boolean> (--colours) [1]
+
+Colorize the output (cyan for info messages, red for errors/warnings)
+
+=item B<PROGRESS>=I<boolean> (--progress) [1]
+
+Show a progress bar when performing tasks on all packages
+
=item B<SILENT>=I<boolean> (--quiet) [0]
-Operate in silent mode if 1
+Operate in silent mode. If B<1>, it also sets PROGRESS=0
=item B<DEBUG>=I<boolean> (--debug) [0]