public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
* [PATCH] api-parse-options.txt: document OPT_CMDMODE()
@ 2016-03-24  9:07 Pranit Bauva
  2016-03-24 16:07 ` Junio C Hamano
  2016-03-25 18:58 ` [PATCH v2] " Pranit Bauva
  0 siblings, 2 replies; 9+ messages in thread
From: Pranit Bauva @ 2016-03-24  9:07 UTC (permalink / raw)
  To: git

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(+)

diff --git a/Documentation/technical/api-parse-options.txt b/Documentation/technical/api-parse-options.txt
index 5f0757d..8130d26 100644
--- a/Documentation/technical/api-parse-options.txt
+++ b/Documentation/technical/api-parse-options.txt
@@ -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()`.
 

--
https://github.com/git/git/pull/219

^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2016-03-25 21:24 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-24  9:07 [PATCH] api-parse-options.txt: document OPT_CMDMODE() Pranit Bauva
2016-03-24 16:07 ` Junio C Hamano
2016-03-24 16:55   ` Pranit Bauva
2016-03-24 17:16     ` Junio C Hamano
2016-03-24 18:04       ` Pranit Bauva
2016-03-25 18:58 ` [PATCH v2] " Pranit Bauva
2016-03-25 19:08   ` Pranit Bauva
2016-03-25 21:24     ` Junio C Hamano
2016-03-25 20:14   ` [PATCH v3] " Pranit Bauva

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox