]> git.corax.cc Git - toolbox/commit
include/opt: Add array options
authorMatthias Kruk <m@m10k.eu>
Sat, 17 Dec 2022 04:50:31 +0000 (13:50 +0900)
committerMatthias Kruk <m@m10k.eu>
Sat, 17 Dec 2022 04:50:31 +0000 (13:50 +0900)
commitce99e872780d84b8424d359cc0bc3d9e2f131110
tree885e68d4a20857cc06d13e51757ee51658d9eba6
parentb3445d90e460eba9dc0f95dbdb80d1c27cda45e8
include/opt: Add array options

Options with multiple values stored in an array can be implemented
using callbacks, but it is somewhat hacky and would be nicer if the
opt module had explicit support for options with multiple values.

This commit adds the "a" attribute, allowing options to be declared
as arrays. The default value of an array option must be the name of
the array that values shall be appended to.
include/opt.sh
test/opt_spec.sh