X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=builtin-fmt-merge-msg.c;h=9d524000b5ba4d9c7566edd5756b68d728ec362b;hb=743c4b7b0fa5422d1bb5dc59c6cb919a881dd98b;hp=fae1482ba91937232f427a3f5dd03c587c3fba57;hpb=d836118be990867be3a4d3ce932f58d761e5e612;p=git.git diff --git a/builtin-fmt-merge-msg.c b/builtin-fmt-merge-msg.c index fae1482ba..9d524000b 100644 --- a/builtin-fmt-merge-msg.c +++ b/builtin-fmt-merge-msg.c @@ -351,7 +351,7 @@ int cmd_fmt_merge_msg(int argc, const char **argv, const char *prefix) struct option options[] = { OPT_BOOLEAN(0, "log", &merge_summary, "populate log with the shortlog"), OPT_BOOLEAN(0, "summary", &merge_summary, "alias for --log"), - OPT_STRING('F', "file", &inpath, "file", "file to read from"), + OPT_FILENAME('F', "file", &inpath, "file to read from"), OPT_END() }; @@ -360,20 +360,19 @@ int cmd_fmt_merge_msg(int argc, const char **argv, const char *prefix) int ret; git_config(fmt_merge_msg_config, NULL); - argc = parse_options(argc, argv, options, fmt_merge_msg_usage, 0); + argc = parse_options(argc, argv, prefix, options, fmt_merge_msg_usage, + 0); if (argc > 0) usage_with_options(fmt_merge_msg_usage, options); - inpath = parse_options_fix_filename(prefix, inpath); if (inpath && strcmp(inpath, "-")) { in = fopen(inpath, "r"); if (!in) - die("cannot open %s", inpath); + die_errno("cannot open '%s'", inpath); } if (strbuf_read(&input, fileno(in), 0) < 0) - die("could not read input file %s", strerror(errno)); - + die_errno("could not read input file"); ret = fmt_merge_msg(merge_summary, &input, &output); if (ret) return ret;