From 729475db5a7207be6118203fb58b581174371cbc Mon Sep 17 00:00:00 2001 From: Ian Kelling Date: Tue, 11 Feb 2020 07:17:48 -0500 Subject: [PATCH] cleanup documentation --- README | 6 ++++-- err | 43 +++++++++++++++++++++++++++++-------------- 2 files changed, 33 insertions(+), 16 deletions(-) diff --git a/README b/README index e23ff99..5200963 100644 --- a/README +++ b/README @@ -1,2 +1,4 @@ -Todo: populate this readme even though -the full manual is in the err file. +SPDX-License-Identifier: GPL-3.0-or-later + +Bash Error Handler. This is a single file library, read the top of it +for documentation. diff --git a/err b/err index ccdffee..2755e24 100644 --- a/err +++ b/err @@ -1,10 +1,35 @@ #!/bin/bash -# Copyright (C) 2019 Ian Kelling +# Bash Error Handler +# Copyright (C) 2020 Ian Kelling # SPDX-License-Identifier: GPL-3.0-or-later +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + + +# This is a single file library, just source this file. When an error +# happens, we print a stack trace then exit. In an interactive shell, we +# return from functions instead of exiting. If err-cleanup is a command, +# it runs before the stack trace. Functions are documented inline below +# for additional use cases. +# +# Please email me if you use this or have anything to contribute. I'm +# not aware of any users yet Ian Kelling . +# +# Tested on bash 4.4.20(1)-release (x86_64-pc-linux-gnu). +# +# Related: see my bash script template repo at https://iankelling.org/git. -# Commentary: Print stack trace and exit/return on errors, or use -# functions below for for more details and manual error handling. See -# end of file for credits etc. # TODO: investigate to see if we can format output betting in case of # subshell failure. Right now, we get independent trace from inside and @@ -225,13 +250,3 @@ _err-bash-trace-interactive() { fi } -# Credits etc: -# -# Related: see my bash script template repo at https://iankelling.org/git. -# -# -# Please email me if you have a patches, bugs, feedback, or if you use -# it or republish it since I'm not aware of any users yet -# Ian Kelling . -# -# Tested on bash 4.4.20(1)-release (x86_64-pc-linux-gnu). If you test -- 2.25.1