* 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
* 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
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
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.
* 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