diff --git a/builtin/merge-ours.c b/builtin/merge-ours.c
index 45945074205332..fb3674a3844dfa 100644
--- a/builtin/merge-ours.c
+++ b/builtin/merge-ours.c
@@ -11,14 +11,20 @@
#include "git-compat-util.h"
#include "builtin.h"
#include "diff.h"
+#include "parse-options.h"
-static const char builtin_merge_ours_usage[] =
- "git merge-ours ... -- HEAD ...";
+static const char * const merge_ours_usage[] = {
+ N_("git merge-ours [...] -- ..."),
+ NULL,
+};
int cmd_merge_ours(int argc, const char **argv, const char *prefix)
{
- if (argc == 2 && !strcmp(argv[1], "-h"))
- usage(builtin_merge_ours_usage);
+ struct option options[] = {
+ OPT_END()
+ };
+
+ argc = parse_options(argc, argv, prefix, options, merge_ours_usage, 0);
/*
* The contents of the current index becomes the tree we
diff --git a/git.c b/git.c
index ce6ab0ece2cc6d..6aee0e94775975 100644
--- a/git.c
+++ b/git.c
@@ -527,7 +527,7 @@ static struct cmd_struct commands[] = {
{ "merge-base", cmd_merge_base, RUN_SETUP },
{ "merge-file", cmd_merge_file, RUN_SETUP_GENTLY },
{ "merge-index", cmd_merge_index, RUN_SETUP | NO_PARSEOPT },
- { "merge-ours", cmd_merge_ours, RUN_SETUP | NO_PARSEOPT },
+ { "merge-ours", cmd_merge_ours, RUN_SETUP },
{ "merge-recursive", cmd_merge_recursive, RUN_SETUP | NEED_WORK_TREE | NO_PARSEOPT },
{ "merge-recursive-ours", cmd_merge_recursive, RUN_SETUP | NEED_WORK_TREE | NO_PARSEOPT },
{ "merge-recursive-theirs", cmd_merge_recursive, RUN_SETUP | NEED_WORK_TREE | NO_PARSEOPT },