]> git.corax.cc Git - toolbox/commit
include/opt: Implement argument validation using regular expressions
authorMatthias Kruk <m@m10k.eu>
Mon, 21 Jun 2021 11:27:57 +0000 (20:27 +0900)
committerMatthias Kruk <m@m10k.eu>
Mon, 21 Jun 2021 11:27:57 +0000 (20:27 +0900)
commit38ae5b673ea063c757859ceba4212e7d6b8ceaea
tree81231eeeb5f7d4ba062f303273736076d232c454
parent2ad47918fe152220f519032625eacd40a6b964ba
include/opt: Implement argument validation using regular expressions

The opt_parse() function does not implement validation of commandline
arguments, leaving it to the caller to sanitize values passed by the
user.
This commit adds an argument to opt_add_arg() that allows the caller
to specify a regular expression that will be used by opt_parse() to
validate user inputs.
include/opt.sh