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

[PATCH 2/5] parse-options: inline parse_options_usage() at its only remaining caller

From
René Scharfe <l.s.r@web.de>
Date
Nov 17, 2015, 10:25 UTC
Message-ID
<564B0097.9050206@web.de>
In-Reply-To
<564AFF32.1030406@web.de>
Signed-off-by: Rene Scharfe <l.s.r@web.de>
---
 parse-options.c | 13 +------------
 1 file changed, 1 insertion(+), 12 deletions(-)
diff --git a/parse-options.c b/parse-options.c
index f0b6d9b..4863966 100644
--- a/parse-options.c
+++ b/parse-options.c
@@ -5,10 +5,6 @@
 #include "color.h"
 #include "utf8.h"
 
-static int parse_options_usage(struct parse_opt_ctx_t *ctx,
-			       const char * const *usagestr,
-			       const struct option *opts, int err);
-
 #define OPT_SHORT 1
 #define OPT_UNSET 2
 
@@ -516,7 +512,7 @@ unknown:
  show_usage_error:
 	err = 1;
  show_usage:
-	return parse_options_usage(ctx, usagestr, options, err);
+	return usage_with_options_internal(ctx, usagestr, options, 0, err);
 }
 
 int parse_options_end(struct parse_opt_ctx_t *ctx)
@@ -662,13 +658,6 @@ void NORETURN usage_msg_opt(const char *msg,
 	usage_with_options(usagestr, options);
 }
 
-static int parse_options_usage(struct parse_opt_ctx_t *ctx,
-			       const char * const *usagestr,
-			       const struct option *opts, int err)
-{
-	return usage_with_options_internal(ctx, usagestr, opts, 0, err);
-}
-
 #undef opterror
 int opterror(const struct option *opt, const char *reason, int flags)
 {
-- 
2.6.3
Previous: René ScharfeNext: René Scharfe
Message 3 of 7 in “parse-options: allow -h as a short option”
  1. 0/5 parse-options: allow -h as a short optionRené Scharfe, Nov 17, 2015
  2. 1/5 parse-options: deduplicate parse_options_usage() callsRené Scharfe, Nov 17, 2015
  3. 2/5 parse-options: inline parse_options_usage() at its only remaining callerRené Scharfe, Nov 17, 2015
  4. 3/5 parse-options: allow -h as a short optionRené Scharfe, Nov 17, 2015
  5. 4/5 grep: stop using PARSE_OPT_NO_INTERNAL_HELPRené Scharfe, Nov 17, 2015
  6. 5/5 show-ref: stop using PARSE_OPT_NO_INTERNAL_HELPRené Scharfe, Nov 17, 2015
  7. Junio C HamanoDec 4, 2015

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.