Re: [PATCH v2 1/4] git-compat-util: introduce skip_to_optional_val()

2017-12-04 Thread Junio C Hamano
Christian Couder writes: > From: Christian Couder > > We often accept both a "--key" option and a "--key=" option. > > These options currently are parsed using something like: > > if (!strcmp(arg, "--key")) { > /* do something */ > }

[PATCH v2 1/4] git-compat-util: introduce skip_to_optional_val()

2017-12-04 Thread Christian Couder
From: Christian Couder We often accept both a "--key" option and a "--key=" option. These options currently are parsed using something like: if (!strcmp(arg, "--key")) { /* do something */ } else if (skip_prefix(arg, "--key=", )) { /* do something