From: Jonathan Tan Date: Wed, 12 Jul 2017 21:10:28 GMT Subject: Re: [PATCH 3/3] interpret-trailers: add options for actions Message-ID: <20170712141028.2d6beecc@twelve2.svl.corp.google.com> In-Reply-To: <20170712134646.17179-4-bonzini@gnu.org> On Wed, 12 Jul 2017 15:46:46 +0200 Paolo Bonzini wrote: > +static int option_parse_where(const struct option *opt, > + const char *arg, int unset) > +{ > + enum action_where *where = opt->value; > + > + if (unset) > + return 0; > + > + return set_where(where, arg); > +} This means that we have the following: $ cat message Hello a: a $ ./git interpret-trailers --trailer a=b message Hello a: a a: b $ ./git interpret-trailers --where start --no-where --trailer a=b message Hello a: b a: a When I would expect the last 2 commands to produce the same output. Maybe invoke set_where(where, NULL) when "unset" is true? And change set_where() accordingly. Same for the other two option parsing functions.