* Add ini file creation if not exists
Add section creation if not exists
Add default section if section not given
Fix read key value only from given (or default) section
* Fix to support platform specific sed
* Fixed typo in comment
* Fix test scenario to reflect changes to the (introduced) default section
* Fix expectations for scenario test
* Fix style guide compatibility
* Add support for declaring arguments as repeatable
If the usage of the argument includes the phrase "Can be repeated.",
the corresponding arg_ variable will be an array containing one element
per instance of the argument.
* Add example and test for using repeated parameters
* Add example and test for using repeated flags
templater.sh now escapes the delimiter it uses for its sed magic within
the environment variable content.
the associated test uses a properly cleaned up temporary file instead of
explicitly rm-ing its own mess.
* Fix shifting over `--`: don't throw errexit
Fixes#21
* Add error trapping (including Ctrl-C) info to FAQ
Closes#47
* Add backtracing to help localize errors
- Fixes#44
- Backtracing is turned on when the debugging `-d` flag is passed,
otherwise backtracing function defined but signal trap not set.
- Update main-help fixture due to moving trap
* Untabify main.sh
Might be a controversial move, but I loath tabs...
* Add checks for tab chars and trailing whitespace
- Update poor-man's style enforcement script to check for these
violations
- Better document style guidlines in README with small tweaks
* Add a magic variable to indicate if being source
if `__i_am_main_script=1 #true` then `main.sh` called directly
Fixes#45
* 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