stash: convert branch to builtin
[gitweb.git] / builtin / multi-pack-index.c
index 6a7aa00cf2e7b1af5597e3cc53b55a14e03eed54..fca70f8e4fcca8432619c41fd68234732a92f07a 100644 (file)
@@ -5,7 +5,7 @@
 #include "midx.h"
 
 static char const * const builtin_multi_pack_index_usage[] = {
-       N_("git multi-pack-index [--object-dir=<dir>] write"),
+       N_("git multi-pack-index [--object-dir=<dir>] (write|verify)"),
        NULL
 };
 
@@ -32,16 +32,18 @@ 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);
-       }
+       if (!strcmp(argv[0], "verify"))
+               return verify_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]);
 }