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

[PATCH 2/3] parse-options.h: rename _OPT_CONTAINS_OR_WITH()'s parameters

From
SZEDER Gábor <szeder.dev@gmail.com>
Date
Mar 19, 2023, 16:56 UTC
Message-ID
<20230319165648.656738-3-szeder.dev@gmail.com>
In-Reply-To
<20230319165648.656738-1-szeder.dev@gmail.com>

Rename the 'help' parameter as it matches one of the fields in 'struct option', and, while at it, rename all other parameters to the usual one-letter name used in similar macro definitions.

Furthermore, put all parameters in the replacement list between parentheses, like all other OPT_* macros do.

Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com>
---
 parse-options.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/parse-options.h b/parse-options.h
index 34f8caf369..7e99322bab 100644
--- a/parse-options.h
+++ b/parse-options.h
@@ -381,9 +381,9 @@ int parse_opt_tracking_mode(const struct option *, const char *, int);
 	{ OPTION_CALLBACK, (s), (l), (v), (a), (h), (f), parse_opt_passthru }
 #define OPT_PASSTHRU_ARGV(s, l, v, a, h, f) \
 	{ OPTION_CALLBACK, (s), (l), (v), (a), (h), (f), parse_opt_passthru_argv }
-#define _OPT_CONTAINS_OR_WITH(name, variable, help, flag) \
-	{ OPTION_CALLBACK, 0, name, (variable), N_("commit"), (help), \
-	  PARSE_OPT_LASTARG_DEFAULT | flag, \
+#define _OPT_CONTAINS_OR_WITH(l, v, h, f) \
+	{ OPTION_CALLBACK, 0, (l), (v), N_("commit"), (h), \
+	  PARSE_OPT_LASTARG_DEFAULT | (f), \
 	  parse_opt_commits, (intptr_t) "HEAD" \
 	}
 #define OPT_CONTAINS(v, h) _OPT_CONTAINS_OR_WITH("contains", v, h, PARSE_OPT_NONEG)
-- 
2.40.0.499.g88fa0b00d2
Previous: SZEDER GáborNext: Junio C Hamano
Message 3 of 6 in “parse-options.h: use designated initializers in OPT_* macros”
  1. 0/3 parse-options.h: use designated initializers in OPT_* macrosSZEDER Gábor, Mar 19, 2023
  2. 1/3 parse-options.h: use consistent name for the callback parametersSZEDER Gábor, Mar 19, 2023
  3. 2/3 parse-options.h: rename _OPT_CONTAINS_OR_WITH()'s parametersSZEDER Gábor, Mar 19, 2023
  4. Junio C HamanoMar 20, 2023
  5. 3/3 parse-options.h: use designated initializers in OPT_* macrosSZEDER Gábor, Mar 19, 2023
  6. Elijah NewrenMar 20, 2023

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.