mirror of
https://github.com/git/git.git
synced 2024-11-24 18:33:43 +08:00
multi-pack-index: provide more helpful usage info
The multi-pack-index builtin has a very simple command-line interface. Instead of simply reporting usage, give the user a hint to why the arguments failed. Reported-by: Eric Sunshine <sunshine@sunshineco.com> Signed-off-by: Derrick Stolee <dstolee@microsoft.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
c00ba2233e
commit
6d68e6a461
@ -32,16 +32,16 @@ int cmd_multi_pack_index(int argc, const char **argv,
|
||||
opts.object_dir = get_object_directory();
|
||||
|
||||
if (argc == 0)
|
||||
goto usage;
|
||||
usage_with_options(builtin_multi_pack_index_usage,
|
||||
builtin_multi_pack_index_options);
|
||||
|
||||
if (!strcmp(argv[0], "write")) {
|
||||
if (argc > 1)
|
||||
goto usage;
|
||||
|
||||
return write_midx_file(opts.object_dir);
|
||||
if (argc > 1) {
|
||||
die(_("too many arguments"));
|
||||
return 1;
|
||||
}
|
||||
|
||||
usage:
|
||||
usage_with_options(builtin_multi_pack_index_usage,
|
||||
builtin_multi_pack_index_options);
|
||||
if (!strcmp(argv[0], "write"))
|
||||
return write_midx_file(opts.object_dir);
|
||||
|
||||
die(_("unrecognized verb: %s"), argv[0]);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user