File tree Expand file tree Collapse file tree 1 file changed +17
-8
lines changed Expand file tree Collapse file tree 1 file changed +17
-8
lines changed Original file line number Diff line number Diff line change @@ -49,15 +49,15 @@ cleanup () {
4949 done
5050}
5151
52- # When debugging, make sure 'sh' is a link to Bash executable
5352debug () (
54- [ " $3 " != " --" ] && [ " $gf_debug " -eq 0 ] && return
55- prg=" $( basename " $0 " ) "
56- func=" $1 " && shift 1
57- lineno=" $1 " && shift 1
58- >&2 printf " [debug] %s @ %s:%d # %s\n" " $prg " " $func " " $lineno " " $* "
53+ [ " $1 " != " --" ] && [ " $gf_debug " -eq 0 ] && return
54+ >&2 printf " [debug] %s" " $( basename " $0 " ) "
55+ if [ -n " $BASH_VERSION " ]; then
56+ # shellcheck disable=SC3028,SC3054
57+ >&2 printf " :%-3d %30s" " ${BASH_LINENO[0]} " " ${FUNCNAME[1]} " ' ()'
58+ fi
59+ >&2 printf " | %s\n" " $* "
5960)
60- alias debug=' debug "$FUNCNAME" "$LINENO"'
6161
6262pat_list_to_case () {
6363 sed ' s/\s*,\s*/|/g'
@@ -355,7 +355,7 @@ process_file () (
355355 a_name=" $4 "
356356 b_name=" ${5:- $a_name } "
357357
358- debug " --- PROCESSING: $b_name --- "
358+ debug " # PROCESSING: $b_name # "
359359 debug " args = " " $@ "
360360
361361 case " $( git_conf_get " $b_name " ignore) " in
496496}
497497
498498# parse options {{{2
499+
500+ case " $@ " in
501+ --debug)
502+ if [ -z " $BASH_VERSION " ] && [ -x " $( command -v bash) " ]; then
503+ exec bash " $0 " " $@ "
504+ fi
505+ ;;
506+ esac
507+
499508while : ; do
500509 case " $1 " in
501510 -h)
You can’t perform that action at this time.
0 commit comments