* install shellcheck from debian sid repository
* cleanup acceptance shell script
use a uniq temp directory and cleanup
make sure commands we use/need are installed
* shellcheck main.sh
* shellcheck example.sh
* shellcheck test/acceptance.sh
* brace all variables, used [[ instead of [
If the description of an option contains the single word sentence
'Required.' it is understood as a required argument and automatic
validation will make sure that it is set or end the script by calling
help.
Alternatively, if the argument within the __usage string is {arg}
instead of [arg] it is understood as a required argument and automatic
validation will make sure that it is set or end the script by calling
help (even if 'Required.' is not in the description).
Closes#22
turn off colors if NO_COLOR is "true" or TERM is not "xterm*" or STDERR
is not connected to a terminal, but ignore TERM and STDERR if NO_COLOR
is set to "false" explicitly.
Fixes#69
If main.sh is being sourced instead of being executed it respects the
variables __usage and __helptext being defined beforehand. Its behaviour
will depend on the sourcing script. If __usage is defined but empty no
argument parsing is done. If __helptext is defined but empty no helptext
will be shown.
Logging support still exists as it did before. The environment variables
LOG_LEVEL and NO_COLOR are supported just as they were before.
turns out that the README.md explains that "... licensed under MIT ...
the LICENSE does not have to be bundled as long as ..." but the scripts
themselfs don't mention any license.
fixed that by adding a one line mention of the used license and the two
lines explaining that the header comments have to stay intact.
* better logging: support for multiple lines
* renamed logging function from _fmt to __b3bp_log
* adding example to show how multiline logging works
the main idea is to be able to log e.g. the output of a command and
b3bp taking care of splitting and prefixing every line.
* simplified code, removed hacky space-at-EOL