# vecho [message]
#
-# vecho outputs a message if EXTRAVERBOSE is selected
+# vecho outputs a message if EXTRAVERBOSE is 1 or more
vecho ()
{
-if [ x"$EXTRAVERBOSE" != "x" ]; then
+if [ x"$EXTRAVERBOSE" != "x" ] && [ $EXTRAVERBOSE -gt 0 ] ; then
+ case $1 in
+ warning) shift ; log warning "$@" ;;
+ *) echo "$@" ;;
+ esac
+fi
+}
+
+# vvecho [message]
+#
+# vvecho outputs a message if EXTRAVERBOSE is 2 or more
+vvecho ()
+{
+if [ x"$EXTRAVERBOSE" != "x" ] && [ $EXTRAVERBOSE -gt 1 ] ; then
case $1 in
warning) shift ; log warning "$@" ;;
*) echo "$@" ;;
fi
fi
+# We used to use EXTRAVERBOSE=y to turn on more debug output. Now
+# that's changed to a number to allow for more control. If
+# EXTRAVERBOSE=y, set it to 1 for backwards compatibility.
+if [ "$EXTRAVERBOSE" = "y" ]; then
+ EXTRAVERBOSE=1
+fi
+if [ "$EXTRAVERBOSE" = "n" ]; then
+ EXTRAVERBOSE=0
+fi
+
# Parse command line options
#while getopts 1a:bc:C:d:Dehj:klLmMnNo:pPq:r:Rs:S:t:T:vVxw:W: opt ; do
while getopts 1a:bBc:C:d:Defghj:klLmMnNo:pPq:r:s:S:t:T:UvVxX:w:W:z opt ; do
echo "abcde -h for extra help"
exit
;;
- V) EXTRAVERBOSE="y" ;;
+ V) EXTRAVERBOSE=$(($EXTRAVERBOSE + 1)) ;;
x) EJECTCD="y" ;;
X) CUE2DISCID="$OPTARG" ;;
w) COMMENT="$OPTARG" ;;
Show the version and exit
.TP
.B \-V
-Be a bit more verbose. On slow networks the CDDB requests might give the
-sensation nothing is happening.
+Be more verbose. On slow networks the CDDB requests might give the
+sensation nothing is happening. Add this more than once to make things
+even more verbose.
.TP
.B \-x
Eject the CD when all tracks have been read. See the EJECTCD configuration
file.
.TP
.B EXTRAVERBOSE
-If set to "y", some operations which are usually now shown to the end user
+If set to "1", some operations which are usually now shown to the end user
are visible, such as CDDB queries. Useful for initial debug and if your
-network/CDDB server is slow.
+network/CDDB server is slow. Set to "2" or more for even more verbose
+output.
.SH EXAMPLES
Possible ways one can call \fBabcde\fR:
.TP
# distmp3host to be installed and running on all remote machines - see README)
#REMOTEHOSTS=foo,bar,baz,quux,qiix
-# Set to obtain some information about actions happening in the background
+# Set to 1,2, etc. to obtain some information about actions happening in the background
# Useful if you have a slow network or CDDB servers seem unresponsive.
-#EXTRAVERBOSE=n
+#EXTRAVERBOSE=0
+ Add suggested diskutil code to auto-detect the CD on OS X.
(Closes issue 45).
* Check that we have $CDDBTOOL before we start. (Closes issue 27).
+ * Change the meaning of EXTRAVERBOSE; previously, it was a y/n option
+ to make things more verbose. Add extra levels of verbosity (0, 1, 2 so
+ far) and a new vvecho() function for callers to use.
[ Colin Tuckley ]
* replace deprecated egrep with grep -E (Closes issue 24).