Thread (41 messages) flat view 41 messages, 4 authors, 2016-06-15

Re: [PATCH 6/6] update-index: migrate to parse-options API

From: Stephen Boyd <hidden>
Date: 2016-06-15 22:50:08

On 11/29/10 19:15, Jonathan Nieder wrote:
+		{OPTION_LOWLEVEL_CALLBACK, 0, "cacheinfo", NULL,
+			"<mode> <object> <path>",
+			"add the specified entry to the index",
+			PARSE_OPT_NOARG | PARSE_OPT_NONEG | PARSE_OPT_LITERAL_ARGHELP,
+			(parse_opt_cb *) cacheinfo_callback},
Doesn't this take arguments and thus shouldn't be marked
PARSE_OPT_NOARG? Confused.
quoted hunk ↗ jump to hunk
@@ -602,151 +799,48 @@ int cmd_update_index(int argc, const char **argv, const char *prefix)
 	if (entries < 0)
 		die("cache corrupted");
 
-	for (i = 1 ; i < argc; i++) {
-		const char *path = argv[i];
-		const char *p;
+	/*
+	 * Custom copy of parse_options() because we want to handle
+	 * filename arguments as they come.
+	 */
+	parse_options_start(&ctx, argc, argv, prefix,
+			    PARSE_OPT_STOP_AT_NON_OPTION);
This will need to take options too, sorry.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help