OPT_CMDMODE() was introduced in the release of 1.8.5 which makes the use
of subcommands in the form of arguments a lot cleaner and easier.
---
Documentation/technical/api-parse-options.txt | 6 ++++++
1 file changed, 6 insertions(+)
@@ -231,6 +231,12 @@ There are some macros to easily define options: pass the command-line option, which can be specified multiple times, to another command.+`OPT_CMDMODE(short, long, &int_var, description, enum_val)`::+ Introduce an option for subcommands. It is useful when you want to use+ the command with a particular sub command only and ignore other sub+ commands it has. It will set `int_var` to enum_val if the argument is+ invoked.+ The last element of the array must be `OPT_END()`.--
OPT_CMDMODE mechanism was introduced in the release of 1.8.5 to actively
notice when multiple "operation mode" options that specify mutually
incompatible operation modes are given.
Signed-off-by: Pranit Bauva <redacted>
---
Documentation/technical/api-parse-options.txt | 7 +++++++
1 file changed, 7 insertions(+)
@@ -231,6 +231,13 @@ There are some macros to easily define options: pass the command-line option, which can be specified multiple times, to another command.+`OPT_CMDMODE(short, long, &int_var, description, enum_val)`::+ Define an "operation mode" option, only one of which in the same+ group of "operating mode" options that share the same `int_var`+ can be given by the user. `enum_val` is set to `int_var` when the+ option is used, but an error is reported if other "operating mode"+ option has already set its value to the same `int_var`.+ The last element of the array must be `OPT_END()`.--
I have used bits from your email. I forgot to add "Helped-by: Junio C
Hamano [off-list ref]" . Could you squash it in?
On Sat, Mar 26, 2016 at 12:28 AM, Pranit Bauva [off-list ref] wrote:
quoted hunk
OPT_CMDMODE mechanism was introduced in the release of 1.8.5 to actively
notice when multiple "operation mode" options that specify mutually
incompatible operation modes are given.
Signed-off-by: Pranit Bauva <redacted>
---
Documentation/technical/api-parse-options.txt | 7 +++++++
1 file changed, 7 insertions(+)
@@ -231,6 +231,13 @@ There are some macros to easily define options: pass the command-line option, which can be specified multiple times, to another command.+`OPT_CMDMODE(short, long, &int_var, description, enum_val)`::+ Define an "operation mode" option, only one of which in the same+ group of "operating mode" options that share the same `int_var`+ can be given by the user. `enum_val` is set to `int_var` when the+ option is used, but an error is reported if other "operating mode"+ option has already set its value to the same `int_var`.+ The last element of the array must be `OPT_END()`.--
OPT_CMDMODE mechanism was introduced in the release of 1.8.5 to actively
notice when multiple "operation mode" options that specify mutually
incompatible operation modes are given.
Helped-by: Junio C Hamano [off-list ref]
Signed-off-by: Pranit Bauva <redacted>
---
Documentation/technical/api-parse-options.txt | 7 +++++++
1 file changed, 7 insertions(+)
@@ -231,6 +231,13 @@ There are some macros to easily define options: pass the command-line option, which can be specified multiple times, to another command.+`OPT_CMDMODE(short, long, &int_var, description, enum_val)`::+ Define an "operation mode" option, only one of which in the same+ group of "operating mode" options that share the same `int_var`+ can be given by the user. `enum_val` is set to `int_var` when the+ option is used, but an error is reported if other "operating mode"+ option has already set its value to the same `int_var`.+ The last element of the array must be `OPT_END()`.--