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

[PATCH 2/3] revert: use OPT_NOOP_NOARG

From
René Scharfe <rene.scharfe@lsrfire.ath.cx>
Date
Sep 28, 2011, 17:47 UTC
Message-ID
<4E835DC6.2040505@lsrfire.ath.cx>
In-Reply-To
<4E835CFE.7020501@lsrfire.ath.cx>
Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
---
 builtin/revert.c |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)
diff --git a/builtin/revert.c b/builtin/revert.c
index 3117776..db5b1d4 100644
--- a/builtin/revert.c
+++ b/builtin/revert.c
@@ -72,12 +72,10 @@ static int option_parse_x(const struct option *opt,
 static void parse_args(int argc, const char **argv)
 {
 	const char * const * usage_str = revert_or_cherry_pick_usage();
-	int noop;
 	struct option options[] = {
 		OPT_BOOLEAN('n', "no-commit", &no_commit, "don't automatically commit"),
 		OPT_BOOLEAN('e', "edit", &edit, "edit the commit message"),
-		{ OPTION_BOOLEAN, 'r', NULL, &noop, NULL, "no-op (backward compatibility)",
-		  PARSE_OPT_NOARG | PARSE_OPT_HIDDEN, NULL, 0 },
+		OPT_NOOP_NOARG('r', NULL),
 		OPT_BOOLEAN('s', "signoff", &signoff, "add Signed-off-by:"),
 		OPT_INTEGER('m', "mainline", &mainline, "parent number"),
 		OPT_RERERE_AUTOUPDATE(&allow_rerere_auto),
-- 
1.7.7.rc2
Previous: René ScharfeNext: René Scharfe
Message 7 of 9 in “parse-options: deprecate OPT_BOOLEAN”
  1. parse-options: deprecate OPT_BOOLEANJunio C Hamano, Sep 27, 2011
  2. archive.c: use OPT_BOOL()Junio C Hamano, Sep 27, 2011
  3. Jeff KingSep 28, 2011
  4. Junio C HamanoSep 28, 2011
  5. Miles BaderSep 28, 2011
  6. 1/3 parseopt: add OPT_NOOP_NOARGRené Scharfe, Sep 28, 2011
  7. 2/3 revert: use OPT_NOOP_NOARGRené Scharfe, Sep 28, 2011
  8. 3/3 apply: use OPT_NOOP_NOARGRené Scharfe, Sep 28, 2011
  9. Junio C HamanoSep 28, 2011

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.