]> git.corax.cc Git - toolbox/commit
include/opt: Don't treat options with values as arrays
authorMatthias Kruk <m@m10k.eu>
Mon, 26 Dec 2022 03:55:32 +0000 (12:55 +0900)
committerMatthias Kruk <m@m10k.eu>
Mon, 26 Dec 2022 04:09:26 +0000 (13:09 +0900)
commita0f1a84d1b518154617ee9aa6096740d724e61bd
tree6dadcd2044aa3385e0cf5c5f863f845aba3960c6
parent103062b3b9fab5929ac5fec8d72979c903e82d67
include/opt: Don't treat options with values as arrays

Because the bit pattern __opt_flag_is_array has more than one set
bit, it is not enough to use a bitwise and to check if an option is
an array, but that is what `opt_print_help()' does.

This commit modifies `opt_print_help()' so that it checks whether
the result of the bitwise and equals __opt_flag_is_array, avoiding
any option with a value to be treated as an array.
include/opt.sh