git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 2/4] OPT__VERBOSE(): clarify its expected use by using OPT_COUNTUP

From
Junio C Hamano <gitster@pobox.com>
Date
Aug 6, 2013, 23:31 UTC
Message-ID
<1375831889-9610-3-git-send-email-gitster@pobox.com>
In-Reply-To
<1375831889-9610-1-git-send-email-gitster@pobox.com>

The parseopt parsing for OPT__VERBOSE() is implemented in terms of OPT_BOOLEAN() and users of it do take advantage of the "counting up" behaviour to implement increasing levels of verbosity by differentiating "git cmd -v" and "git cmd -v -v".

Clarify this by explicitly using OPT_COUNTUP() instead.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 parse-options.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/parse-options.h b/parse-options.h
index f2b01ee..582dd4b 100644
--- a/parse-options.h
+++ b/parse-options.h
@@ -230,7 +230,7 @@ extern int parse_opt_tertiary(const struct option *, const char *, int);
 extern int parse_opt_string_list(const struct option *, const char *, int);
 extern int parse_opt_noop_cb(const struct option *, const char *, int);
 
-#define OPT__VERBOSE(var, h)  OPT_BOOLEAN('v', "verbose", (var), (h))
+#define OPT__VERBOSE(var, h)  OPT_COUNTUP('v', "verbose", (var), (h))
 #define OPT__QUIET(var, h)    OPT_BOOL('q', "quiet",   (var), (h))
 #define OPT__VERBOSITY(var) \
 	{ OPTION_CALLBACK, 'v', "verbose", (var), NULL, N_("be more verbose"), \
-- 
1.8.4-rc1-210-gf6d87e2
Previous: Junio C HamanoNext: Junio C Hamano
Message 23 of 27 in “[PATCHv3 0/9] Removing deprecated parsing macros”
  1. Stefan BellerAug 3, 2013
  2. 1/9 Remove deprecated OPTION_BOOLEAN for parsing argumentsStefan Beller, Aug 3, 2013
  3. 2/9 Replace deprecated OPT_BOOLEAN by OPT_BOOLStefan Beller, Aug 3, 2013
  4. 3/9 log, format-patch: parsing uses OPT__QUIETStefan Beller, Aug 3, 2013
  5. 4/9 checkout: remove superfluous local variableStefan Beller, Aug 3, 2013
  6. 5/9 branch, commit, name-rev: ease up boolean conditionsStefan Beller, Aug 3, 2013
  7. 6/9 hash-object: Replace stdin parsing OPT_BOOLEAN by OPT_COUNTUPStefan Beller, Aug 3, 2013
  8. Junio C HamanoAug 5, 2013
  9. 7/9 config parsing options: allow one flag multiple timesStefan Beller, Aug 3, 2013
  10. Junio C HamanoAug 5, 2013
  11. 8/9 checkout-index: Fix negations of even numbers of -nStefan Beller, Aug 3, 2013
  12. 9/9 revert: use the OPT_CMDMODE for parsing, reducing codeStefan Beller, Aug 3, 2013
  13. Stefan BellerAug 3, 2013
  14. Junio C HamanoAug 6, 2013
  15. Stefan BellerAug 6, 2013
  16. branch, commit, name-rev: ease up boolean conditionsStefan Beller, Aug 6, 2013
  17. Eric SunshineAug 6, 2013
  18. Stefan BellerAug 6, 2013
  19. branch, commit, name-rev: ease up boolean conditionsStefan Beller, Aug 6, 2013
  20. Junio C HamanoAug 6, 2013
  21. 0/4 Update built-in parseopt macrosJunio C Hamano, Aug 6, 2013
  22. 1/4 OPT__QUIET(): switch from count-up to true boolJunio C Hamano, Aug 6, 2013
  23. 2/4 OPT__VERBOSE(): clarify its expected use by using OPT_COUNTUPJunio C Hamano, Aug 6, 2013
  24. 3/4 OPT__DRY_RUN(): use OPT_BOOL, not OPT_BOOLEANJunio C Hamano, Aug 6, 2013
  25. 4/4 OPT__FORCE(): clarify its expected use by using OPT_COUNTUPJunio C Hamano, Aug 6, 2013
  26. Stefan BellerAug 7, 2013
  27. Junio C HamanoAug 7, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.