]> git.ipfire.org Git - thirdparty/git.git/commitdiff
bundle <cmd>: have usage_msg_opt() note the missing "<file>"
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>
Tue, 27 Dec 2022 18:39:10 +0000 (19:39 +0100)
committerJunio C Hamano <gitster@pobox.com>
Tue, 27 Dec 2022 23:30:52 +0000 (08:30 +0900)
Improve the usage we emit on e.g. "git bundle create" to note why
we're showing the usage, it's because the "<file>" argument is
missing.

We know that'll be the case for all parse_options_cmd_bundle() users,
as they're passing the "char **bundle_file" parameter, which as the
context shows we're expected to populate.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/bundle.c

index 34b4aa611b5e6aa22e6a36459eb70ac800d2bb20..4b63574c98dda7a47aff6cf578230a736f411aa2 100644 (file)
@@ -48,7 +48,7 @@ static int parse_options_cmd_bundle(int argc,
        argc = parse_options(argc, argv, NULL, options, usagestr,
                             PARSE_OPT_STOP_AT_NON_OPTION);
        if (!argc)
-               usage_with_options(usagestr, options);
+               usage_msg_opt(_("need a <file> argument"), usagestr, options);
        *bundle_file = prefix_filename(prefix, argv[0]);
        return argc;
 }