Git development
 help / color / mirror / Atom feed
From: Sun He <sunheehnus@gmail.com>
To: git@vger.kernel.org
Cc: mhagger@alum.mit.edu, Sun He <sunheehnus@gmail.com>
Subject: [PATCH] OPTION_CMDMODE should be used when not accept an argument, and OPTION_NUMBER is of special type. So change the mode to OPTION_CMDMODE
Date: Fri, 28 Feb 2014 22:29:25 +0800	[thread overview]
Message-ID: <1393597765-14164-1-git-send-email-sunheehnus@gmail.com> (raw)

Signed-off-by: Sun He <sunheehnus@gmail.com>
---
 parse-options.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/parse-options.c b/parse-options.c
index 7b8d3fa..59a52b0 100644
--- a/parse-options.c
+++ b/parse-options.c
@@ -371,7 +371,7 @@ static void parse_options_check(const struct option *opts)
 		case OPTION_NEGBIT:
 		case OPTION_SET_INT:
 		case OPTION_SET_PTR:
-		case OPTION_NUMBER:
+		case OPTION_CMDMODE:
 			if ((opts->flags & PARSE_OPT_OPTARG) ||
 			    !(opts->flags & PARSE_OPT_NOARG))
 				err |= optbug(opts, "should not accept an argument");
-- 
1.9.0.138.g2de3478.dirty
---
I came across this protential bug.
According to parse-options.h OPTION_CMDMODE is an option with noarguments and OPTION_NUMBER is special type option.

Thanks,
He Sun

             reply	other threads:[~2014-02-28 14:31 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-28 14:29 Sun He [this message]
2014-02-28 14:32 ` [PATCH] OPTION_CMDMODE should be used when not accept an argument, and OPTION_NUMBER is of special type. So change the mode to OPTION_CMDMODE 孙赫
2014-02-28 14:42   ` Duy Nguyen
2014-02-28 15:21     ` 孙赫
2014-02-28 20:02     ` Junio C Hamano
2014-02-28 23:50       ` He Sun

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1393597765-14164-1-git-send-email-sunheehnus@gmail.com \
    --to=sunheehnus@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=mhagger@alum.mit.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox