Skip to content

Commit 777dec6

Browse files
committed
Merge branch 'sg/test-lib-simplify-expr-away' into HEAD
Code cleanup. * sg/test-lib-simplify-expr-away: test-lib: simplify '--option=value' parsing
2 parents 14af79b + 0ff7410 commit 777dec6

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

t/test-lib.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -202,13 +202,13 @@ do
202202
}
203203
run_list=$1; shift ;;
204204
--run=*)
205-
run_list=$(expr "z$1" : 'z[^=]*=\(.*\)'); shift ;;
205+
run_list=${1#--*=}; shift ;;
206206
-h|--h|--he|--hel|--help)
207207
help=t; shift ;;
208208
-v|--v|--ve|--ver|--verb|--verbo|--verbos|--verbose)
209209
verbose=t; shift ;;
210210
--verbose-only=*)
211-
verbose_only=$(expr "z$1" : 'z[^=]*=\(.*\)')
211+
verbose_only=${1#--*=}
212212
shift ;;
213213
-q|--q|--qu|--qui|--quie|--quiet)
214214
# Ignore --quiet under a TAP::Harness. Saying how many tests
@@ -222,15 +222,15 @@ do
222222
valgrind=memcheck
223223
shift ;;
224224
--valgrind=*)
225-
valgrind=$(expr "z$1" : 'z[^=]*=\(.*\)')
225+
valgrind=${1#--*=}
226226
shift ;;
227227
--valgrind-only=*)
228-
valgrind_only=$(expr "z$1" : 'z[^=]*=\(.*\)')
228+
valgrind_only=${1#--*=}
229229
shift ;;
230230
--tee)
231231
shift ;; # was handled already
232232
--root=*)
233-
root=$(expr "z$1" : 'z[^=]*=\(.*\)')
233+
root=${1#--*=}
234234
shift ;;
235235
--chain-lint)
236236
GIT_TEST_CHAIN_LINT=1

0 commit comments

Comments
 (0)