diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2020-02-20 15:15:16 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2020-02-20 13:20:40 -0800 |
commit | bc8620b44094e9fb6fc20d141678f9b845c19193 (patch) | |
tree | a2120bed53eaf4ae3028c1dab988b3428fb5661e /help.c | |
parent | parse-options: add testcases for OPT_CMDMODE() (diff) | |
download | tgif-bc8620b44094e9fb6fc20d141678f9b845c19193.tar.xz |
parse-options: convert "command mode" to a flag
OPTION_CMDMODE is essentially OPTION_SET_INT plus an extra check that
the variable had not set before. In order to allow custom processing
of the option, for example a "command mode" option that also has an
argument, it would be nice to use OPTION_CALLBACK and not have to rewrite
the extra check on incompatible options. In other words, making the
processing of the option orthogonal to the "only one of these" behavior
provided by OPTION_CMDMODE.
Add a new flag that takes care of the check, and modify OPT_CMDMODE to
use it together with OPTION_SET_INT. The new flag still requires that the
option value points to an int, but any OPTION_* value can be specified as
long as it does not require a non-int type for opt->value.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'help.c')
0 files changed, 0 insertions, 0 deletions