Simplify handling of command-line verbose option:
Previously, there was a $VERBOSE script variable that was set according to the "-v" command line option and then reset to null within each source sub-shell. With no loss of functionality, this patch removes all references to that variable. This makes the script 13 lines shorter.
This commit is contained in:
parent
a4c61e7b68
commit
ea16af51b2
1 changed files with 1 additions and 14 deletions
15
ccollect.sh
15
ccollect.sh
|
@ -153,7 +153,6 @@ no_sources=0
|
||||||
#
|
#
|
||||||
WE=""
|
WE=""
|
||||||
ALL=""
|
ALL=""
|
||||||
VERBOSE=""
|
|
||||||
NO_MORE_ARGS=""
|
NO_MORE_ARGS=""
|
||||||
while [ "$#" -ge 1 ]; do
|
while [ "$#" -ge 1 ]; do
|
||||||
eval arg=\"\$1\"; shift
|
eval arg=\"\$1\"; shift
|
||||||
|
@ -170,7 +169,7 @@ while [ "$#" -ge 1 ]; do
|
||||||
ALL=1
|
ALL=1
|
||||||
;;
|
;;
|
||||||
-v|--verbose)
|
-v|--verbose)
|
||||||
VERBOSE=1
|
set -x
|
||||||
;;
|
;;
|
||||||
-p|--parallel)
|
-p|--parallel)
|
||||||
PARALLEL=1
|
PARALLEL=1
|
||||||
|
@ -194,13 +193,6 @@ done
|
||||||
# also export number of sources
|
# also export number of sources
|
||||||
export no_sources
|
export no_sources
|
||||||
|
|
||||||
#
|
|
||||||
# be really, really, really verbose
|
|
||||||
#
|
|
||||||
if [ "${VERBOSE}" = 1 ]; then
|
|
||||||
set -x
|
|
||||||
fi
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Look, if we should take ALL sources
|
# Look, if we should take ALL sources
|
||||||
#
|
#
|
||||||
|
@ -307,11 +299,6 @@ while [ "${i}" -lt "${no_sources}" ]; do
|
||||||
#
|
#
|
||||||
begin_s=$(date +%s)
|
begin_s=$(date +%s)
|
||||||
|
|
||||||
#
|
|
||||||
# unset possible options
|
|
||||||
#
|
|
||||||
VERBOSE=""
|
|
||||||
|
|
||||||
_techo "Beginning to backup"
|
_techo "Beginning to backup"
|
||||||
|
|
||||||
#
|
#
|
||||||
|
|
Loading…
Reference in a new issue