From eab98ee5ab84def96012f115a8e10571c6e24e4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=86var=20Arnfj=C3=B6r=C3=B0=20Bjarmason?= Date: Fri, 24 Mar 2017 18:40:53 +0000 Subject: parse-options: add OPT_NONEG to the "contains" option MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add the OPT_NONEG flag to the "contains" option and its hidden synonym "with". Since this was added in commit 694a577519 ("git-branch --contains=commit", 2007-11-07) giving --no-{contains,with} hasn't been an error, but has emitted the help output since filter.with_commit wouldn't get set. Now git will emit "error: unknown option `no-{contains,with}'" at the top of the help output. Signed-off-by: Ævar Arnfjörð Bjarmason Signed-off-by: Junio C Hamano --- parse-options.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'parse-options.h') diff --git a/parse-options.h b/parse-options.h index dcd8a0926..9f48f554b 100644 --- a/parse-options.h +++ b/parse-options.h @@ -258,7 +258,7 @@ extern int parse_opt_passthru_argv(const struct option *, const char *, int); PARSE_OPT_LASTARG_DEFAULT | flag, \ parse_opt_commits, (intptr_t) "HEAD" \ } -#define OPT_CONTAINS(v, h) _OPT_CONTAINS_OR_WITH("contains", v, h, 0) -#define OPT_WITH(v, h) _OPT_CONTAINS_OR_WITH("with", v, h, PARSE_OPT_HIDDEN) +#define OPT_CONTAINS(v, h) _OPT_CONTAINS_OR_WITH("contains", v, h, PARSE_OPT_NONEG) +#define OPT_WITH(v, h) _OPT_CONTAINS_OR_WITH("with", v, h, PARSE_OPT_HIDDEN | PARSE_OPT_NONEG) #endif -- cgit v1.2.1