Re: [RFC PATCH] parse-options: disallow double-negations of options starting with no-
- From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
- Date
- Apr 19, 2017, 09:34 UTC
- Message-ID
- <CACBZZX5_fJ9w_K4H8R-NMi7kiR5QkR35pRqvzDRr_=rhMSQvfg@mail.gmail.com>
- In-Reply-To
- <20170419090820.20279-1-jacob.e.keller@intel.com>
On Wed, Apr 19, 2017 at 11:08 AM, Jacob Keller <jacob.e.keller@intel.com> wrote:
Show 14 quoted lines
> Many options can be negated by prefixing the option with "no-", for
> example "--3way" can be prefixed with "--no-3way" to disable it. Since
> 0f1930c58754 ("parse-options: allow positivation of options
> starting, with no-", 2012-02-25) we have also had support to negate
> options which start with "no-" by using the positive wording.
>
> This leads to the confusing (and non-documented) case that you can still
> prefix options beginning with "no-" by a second "no-" to negate them.
> That is, we allow "no-no-hardlinks" to negate the "no-hardlinks" option.
>
> This can be confusing to the user so lets just disallow the
> double-negative forms. If the long_name begins with "no-" then we simply
> don't allow the regular negation format, and only allow the option to be
> negated by the positive form.Looks good to me. Addresses the bug I was trying to fix much better than my patch.