# See the License for the specific language governing permissions and
# limitations under the License.
-# Undo the complimentary errcatch function
-errallow() { set +eE +o pipefail; trap ERR; }
+errallow() {
+ if [[ $1 ]]; then
+ echo "errallow help: Undo the complimentary errcatch function."
+ else
+ set +eE +o pipefail; trap ERR
+ fi
+}
# See the License for the specific language governing permissions and
# limitations under the License.
-# General purpose bash error handling setup
-# Exit on all errors. Print useful information.
-errcatch() {
- set -eE;
- trap 'echo "${BASH_COMMAND:+BASH_COMMAND=\"$BASH_COMMAND\" }
+errcatch() {
+ if [[ $1 ]]; then
+ echo "errcatch help: Enable general purpose bash error handling.
+Exit on all errors and print useful information."
+ else
+ set -eE;
+ trap 'echo "${BASH_COMMAND:+BASH_COMMAND=\"$BASH_COMMAND\" }
${FUNCNAME:+FUNCNAME=\"$FUNCNAME\" }${LINENO:+LINENO=\"$LINENO\" }\$?=$?"' ERR
- set -o pipefail
+ set -o pipefail
+ fi
}