]> mj.ucw.cz Git - libucw.git/commit
Opt: Simpified and corrected processing of OPT_SINGLE
authorMartin Mares <mj@ucw.cz>
Mon, 27 Jan 2014 16:13:46 +0000 (17:13 +0100)
committerMartin Mares <mj@ucw.cz>
Mon, 27 Jan 2014 16:13:46 +0000 (17:13 +0100)
commitf89145376775da7f15fe6d654a287c57ea3d38da
tree493d5dfb3923f46e19563b70fad258cf04017320
parent0e17ad98def5abb90b274921fb57a35ee980b564
Opt: Simpified and corrected processing of OPT_SINGLE

OPT_SINGLE is now checked in opt_parse_value(). Previously, short,
long, and positional options had their own checks.

OPT_CL_SWITCH did not allow changing the value of the switch once
it is set, although documentation in opt.h claimed quite the opposite.
Changes are currently allowed unless OPT_SINGLE is set.

Test cases have been updated accordingly.
ucw/opt-test.c
ucw/opt.c
ucw/opt.t