]> git.corax.cc Git - toolbox/commit
include/opt: Emit an error message when an option is redefined
authorMatthias Kruk <m@m10k.eu>
Thu, 11 Aug 2022 12:27:49 +0000 (21:27 +0900)
committerMatthias Kruk <m@m10k.eu>
Thu, 11 Aug 2022 12:27:49 +0000 (21:27 +0900)
commit8faa458a58974b8fb21d16ec96675459bd84fb23
treeccf8cd7909ee50968a625c494902933d8fdc0bd7
parent78bf3673f66f72edfdc87ce20c4bfd89e3f4450e
include/opt: Emit an error message when an option is redefined

When the caller attempts to redefine an option, `opt_add_arg()` fails
without printing an error message, leaving the situation undetected
if the caller does not check the return value of the call.

This commit modifies `opt_add_arg()` to print an error message when
a caller attempts to redefine an option.
include/opt.sh