70dd6b262e446638074eabf7dc21aac08e8e678b
2 # Copyright 2018 Ian Kelling
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
8 # http://www.apache.org/licenses/LICENSE-2.0
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
16 # this file was generated from gen-err and meant to be sourced
19 echo "errallow help: Undo the complimentary errcatch function."
21 set +E
+o pipefail
; trap ERR
25 local -i argc_index
=0 frame i start
=${1:-1} max_indent
=8 indent
28 if [[ $
(shopt -p extdebug
) == *-s* ]]; then
31 for ((frame
=0; frame
< ${#FUNCNAME[@]}-1; frame
++)); do
32 argc
=${BASH_ARGC[frame]}
34 ((frame
< start
)) && continue
35 if (( ${#BASH_SOURCE[@]} > 1 )); then
36 source="${BASH_SOURCE[frame+1]}:${BASH_LINENO[frame]}:"
38 indent
=$
((frame-start
+1))
39 indent
=$
((indent
< max_indent ? indent
: max_indent
))
40 printf "%${indent}s↳%sin \`%s" '' "$source" "${FUNCNAME[frame]}"
42 for ((i
=argc_index-1
; i
>= argc_index-argc
; i--
)); do
43 printf " %s" "${BASH_ARGV[i]}"
50 set -E; shopt -s extdebug
55 echo "${BASH_SOURCE[1]}:${BASH_LINENO[0]}:in \`$BASH_COMMAND' returned $err"
58 "${_errcatch_cleanup[@]}"
59 echo "$0: exiting with code $err"
69 if [[ ${1/[^0-9]/} == "$1" ]]; then
78 echo "${BASH_SOURCE[1]}:${BASH_LINENO[0]}"
80 echo "$0: exiting with code $code"