Re: [PATCH 6/6] update-index: migrate to parse-options API
- From
Stephen Boyd <bebarino@gmail.com>
- Date
- Nov 30, 2010, 08:13 UTC
- Message-ID
- <4CF4B234.9060206@gmail.com>
- In-Reply-To
- <20101130031549.GG5326@burratino>
On 11/29/10 19:15, Jonathan Nieder wrote:
Show 5 quoted lines
> + {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.
Show 13 quoted lines
> @@ -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.