Skip to contentSkip to conversation

OPTION_CMDMODE should be used when not accept an argument, and OPTION_NUMBER is of special type. So change the mode to OPTION_CMDMODE

PATCH In review Sun He 3 participants 6 messages Jun 15, 2016

lore
Share & tools
lore

Sun He

author
#0 lore raw

PATCH 1/1 OPTION_CMDMODE should be used when not accept an argument, and OPTION_NUMBER is of special type. So change the mode to OPTION_CMDMODE

---
 parse-options.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
parse-options.c +1 -1
index 7b8d3fa..59a52b0 100644
@@ -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");
Signature · 7 lines
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
author
#1 lore raw

I am not sure if this is a bug.
I need your help to find out it.

Cheers,
He Sun

2014-02-28 22:29 GMT+08:00 Sun He <[email protected]>:

Quoted 26 lines
---
 parse-options.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
parse-options.c +1 -2
index 7b8d3fa..59a52b0 100644
@@ -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

#2 lore raw

Way too long subject line. Keep it within 70-75 chars. The rest could be put in the body.

Quoted 2 lines · 孙赫

I am not sure if this is a bug.
I need your help to find out it.

Tip:git has a wonderful history (most of it anyway). Try "git log --patch parse-options.[ch]" to understand parse-options evolution. Add -SOPTION_NUMBER (or -SOPTION_CMDMODE) to limit to only commits whose diff contains that keyword.

Signature · 1 line
Duy
author
#3 lore raw

2014-02-28 22:43 GMT+08:00 Duy Nguyen [via git]
<[email protected]>:

Quoted 7 lines

Way too long subject line. Keep it within 70-75 chars. The rest could be put in the body.

Quoted 2 lines · 孙赫

I am not sure if this is a bug.
I need your help to find out it.

Quoted 7 lines

Tip:git has a wonderful history (most of it anyway). Try "git log --patch parse-options.[ch]" to understand parse-options evolution. Add -SOPTION_NUMBER (or -SOPTION_CMDMODE) to limit to only commits whose diff contains that keyword.
--
Duy
--

Got it,
Thanks

Quoted 13 lines

To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to [hidden email]
More majordomo info at http://vger.kernel.org/majordomo-info.html

________________________________
If you reply to this email, your message will be added to the discussion below:
http://git.661346.n2.nabble.com/PATCH-OPTION-CMDMODE-should-be-used-when-not-accept-an-argument-and-OPTION-NUMBER-is-of-special-typeE-tp7604513p7604517.html
To start a new topic under git, email [email protected]
To unsubscribe from git, click here.
NAML

#4 lore raw
In reply to Duy Nguyen
Quoted 11 lines · Duy Nguyen

Way too long subject line. Keep it within 70-75 chars. The rest could be put in the body.

Quoted 2 lines · 孙赫

I am not sure if this is a bug.
I need your help to find out it.

Tip:git has a wonderful history (most of it anyway). Try "git log --patch parse-options.[ch]" to understand parse-options evolution. Add -SOPTION_NUMBER (or -SOPTION_CMDMODE) to limit to only commits whose diff contains that keyword.

Also, I do not think this should be done in a single patch. What if it turns out that explicitly making sure that CMDMODE does not take any argument is a good idea, but the other change is a bad one?

author
#5 lore raw

2014-03-01 4:02 GMT+08:00 Junio C Hamano [via git] <[email protected]>:

Quoted 9 lines
Quoted 7 lines · Duy Nguyen

Way too long subject line. Keep it within 70-75 chars. The rest could be put in the body.

Quoted 2 lines · 孙赫

I am not sure if this is a bug.
I need your help to find out it.

Quoted 8 lines
Quoted 4 lines

Tip:git has a wonderful history (most of it anyway). Try "git log --patch parse-options.[ch]" to understand parse-options evolution. Add -SOPTION_NUMBER (or -SOPTION_CMDMODE) to limit to only commits whose diff contains that keyword.

Also, I do not think this should be done in a single patch. What if it turns out that explicitly making sure that CMDMODE does not take any argument is a good idea, but the other change is a bad one?

OK, I will try to figure it out.

Quoted 14 lines

--
To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to [hidden email]
More majordomo info at http://vger.kernel.org/majordomo-info.html

________________________________
If you reply to this email, your message will be added to the discussion below:
http://git.661346.n2.nabble.com/PATCH-OPTION-CMDMODE-should-be-used-when-not-accept-an-argument-and-OPTION-NUMBER-is-of-special-typeE-tp7604513p7604560.html
To start a new topic under git, email [email protected]
To unsubscribe from git, click here.
NAML