Jeff King <peff@xxxxxxxx> writes: > > + else if (starts_with(arg, "-B") || > + skip_to_optional_arg(arg, "--break-rewrites", NULL)) { > if ((options->break_opt = diff_scoreopt_parse(arg)) == -1) > > So that's kind-of weird, because we are parsing "-B", etc, and then > expecting it to be _reparsed_ by diff_scoreopt_parse. So the two > callsites must always match. Correct. diff_scoreopt_parse() can be coaxed to fit better within this if/else if/... cascade by making it take a pointer to .break_opt field and have it return "did I handle the -B/break-rewrites?" etc., but otherwise, this shows that skip_to_optional_arg() has impedance mismatch with its current API. And the NULL thing serves as a reminder that skip_to_optional_arg() is used _only_ as a prefix check and not for parsing.