"Derrick Stolee via GitGitGadget" <gitgitgadget@xxxxxxxxx> writes: > + if (fixed_value) { > + int allowed_usage = 0; > + > + switch (actions) { > + case ACTION_GET: > + case ACTION_GET_ALL: > + case ACTION_GET_REGEXP: > + case ACTION_UNSET: > + case ACTION_UNSET_ALL: > + allowed_usage = argc > 1 && !!argv[1]; > + break; > + > + case ACTION_SET_ALL: > + case ACTION_REPLACE_ALL: > + allowed_usage = argc > 2 && !!argv[2]; > + break; Implicitly all other ops do not want to work with the --fixed-value option, which makes sense. > + } > + > + if (!allowed_usage) { > + error(_("--fixed-value only applies with 'value_regex'")); > + usage_builtin_config(); > + } > + } I was afraid that abandoning the bitmask based approach of the previous round may bloat the code but seeing the result here makes me quite happy ;-) It is quite clear what is going on. Nice.