summaryrefslogtreecommitdiff
path: root/builtin/multi-pack-index.c
diff options
context:
space:
mode:
authorDerrick Stolee <dstolee@microsoft.com>2018-08-20 16:51:53 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-08-20 22:31:39 (GMT)
commit6d68e6a46174746d95373a47ab4ef4f57aa56d22 (patch)
tree87156f90a8fe70dca7a37d37248efe7185f290f2 /builtin/multi-pack-index.c
parentc00ba2233ef7dcfa478068c75bc4b25a7ac2a0a8 (diff)
downloadgit-6d68e6a46174746d95373a47ab4ef4f57aa56d22.zip
git-6d68e6a46174746d95373a47ab4ef4f57aa56d22.tar.gz
git-6d68e6a46174746d95373a47ab4ef4f57aa56d22.tar.bz2
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>
Diffstat (limited to 'builtin/multi-pack-index.c')
-rw-r--r--builtin/multi-pack-index.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/builtin/multi-pack-index.c b/builtin/multi-pack-index.c
index 6a7aa00..2633efd 100644
--- a/builtin/multi-pack-index.c
+++ b/builtin/multi-pack-index.c
@@ -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;
+ if (argc > 1) {
+ die(_("too many arguments"));
+ return 1;
+ }
+ if (!strcmp(argv[0], "write"))
return write_midx_file(opts.object_dir);
- }
-usage:
- usage_with_options(builtin_multi_pack_index_usage,
- builtin_multi_pack_index_options);
+ die(_("unrecognized verb: %s"), argv[0]);
}