]> git.corax.cc Git - toolbox/commit
include/opt: Add a default regex and action
authorMatthias Kruk <m@m10k.eu>
Thu, 11 Aug 2022 18:21:40 +0000 (03:21 +0900)
committerMatthias Kruk <m@m10k.eu>
Thu, 11 Aug 2022 18:21:40 +0000 (03:21 +0900)
commit6f17df841c99801a055a7d13df1fd89c59d8d4c7
tree1b34db327ad10c191647e657e2a3874c4894d60c
parent8efd23d2548e1aebf0d7a36bf065ddf3c0b9dbba
include/opt: Add a default regex and action

The regex and action of an option may be unset, making it necessary
to check their value before using them.

This commit modifies the opt module to define a default regex and
action in case the user didn't provide one, allowing the parser to
omit checks if the two are unset.
include/opt.sh