File tree Expand file tree Collapse file tree 3 files changed +19
-6
lines changed
Expand file tree Collapse file tree 3 files changed +19
-6
lines changed Original file line number Diff line number Diff line change 11.PHONY : test doc release
22
33BIN := bin/shove
4- VERSION := $(shell $(BIN ) -v )
4+ VERSION := $(shell $(BIN ) -V )
55
66SHELLS := /bin/sh /bin/bash /bin/zsh dash
77TESTS := t/basic.t t/group.t
Original file line number Diff line number Diff line change @@ -25,10 +25,14 @@ for opt in "$@"; do
2525 shift 2
2626 fi
2727 ;;
28+ " -v" | " --verbose" )
29+ SHOVE_VERBOSE=1
30+ shift
31+ ;;
2832 " -h" | " --help" )
2933 help
3034 ;;
31- " -v " | " --version" )
35+ " -V " | " --version" )
3236 echo $version
3337 exit 0
3438 ;;
@@ -45,10 +49,16 @@ SHOVE_SHELL=${SHOVE_SHELL:-$SHELL}
4549SHOVE_TMPFILE=./.shove.tmp.sh
4650
4751: > $SHOVE_TMPFILE
48- echo " . ${bin_dir} /../lib/t.shrc" >> $SHOVE_TMPFILE
49- echo " t_init" >> $SHOVE_TMPFILE
52+ _add () {
53+ echo " $1 " >> $SHOVE_TMPFILE
54+ }
55+ _add " . ${bin_dir} /../lib/t.shrc"
56+ _add " t_init"
57+ if [[ ${SHOVE_VERBOSE:- } ]]; then
58+ _add " __t_verbose=1"
59+ fi
5060cat $target >> $SHOVE_TMPFILE
51- echo " t_report" >> $SHOVE_TMPFILE
61+ _add " t_report"
5262
5363if [ ${SHOVE_DEBUG:- } ]; then
5464 SHOVE_SHELL=" $SHOVE_SHELL -x"
Original file line number Diff line number Diff line change 66__t_ng=0
77__t_shell=""
88__t_level=0
9+ __t_verbose=""
910
1011_t_incr() {
1112 local _var=$1
@@ -68,7 +69,9 @@ t_diag() {
6869}
6970
7071t_pass() {
71- _t_put "ok $__t_idx - ${1:-pass}"
72+ if [ "$__t_verbose" ]; then
73+ _t_put "ok $__t_idx - ${1:-pass}"
74+ fi
7275 _t_either __t_ok
7376 return 0
7477}
You can’t perform that action at this time.
0 commit comments