for those time you simply have to work with bash but you want you script to be top notch! this tool is basically a collection of smaller tools i gathered over time some wrote by me, some i just improved or adapted.
This wrapper will allow you to display colorful logging along with actual logfile to be generated by your scripts tha basics of using the logs are:
info "info message text"
warn "warn message text"
error "error message text"
exit_on_error "error message text" "<exit code>"
up until now you had to either used numbered arguments ./script.sh $1 $2 $3 ...
or somtimes ./script.sh $@
so to give a more practical example:
./script.sh -arg1 "foo" -arg2 "bar"
and within the script you will have the following variables:
ARG1='foo'
ARG2='bar'
now you can validate by using the validate_args "VAR1" "VAR2" if the variable is not defined you will recieve an elborate error on it being missing
just clone the repo to the location of your choosing
running the built-in test script will show you and example of the functions mentioned above. this script will exit with an error, it should be doing that.
./bash_tools_tester.sh -t foo -r bar
source /path/to/folder/bash_toolkit.sh from this point on you can simply call upon the functions
Please let me know should you have any issues and/or requests: talknopf@gmail.com