Skip to content

Commit 52cb390

Browse files
committed
help: show command mode options at the top
Show --continue/--skip etc. consistently at the top of help printed by -h. Signed-off-by: Phillip Wood <[email protected]>
1 parent 6d06f0d commit 52cb390

File tree

3 files changed

+38
-38
lines changed

3 files changed

+38
-38
lines changed

builtin/am.c

+18-18
Original file line numberDiff line numberDiff line change
@@ -2163,6 +2163,24 @@ int cmd_am(int argc, const char **argv, const char *prefix)
21632163
};
21642164

21652165
struct option options[] = {
2166+
OPT_CMDMODE(0, "continue", &resume,
2167+
N_("continue applying patches after resolving a conflict"),
2168+
RESUME_RESOLVED),
2169+
OPT_CMDMODE(0, "skip", &resume,
2170+
N_("skip the current patch"),
2171+
RESUME_SKIP),
2172+
OPT_CMDMODE(0, "abort", &resume,
2173+
N_("restore the original branch and abort the patching operation."),
2174+
RESUME_ABORT),
2175+
OPT_CMDMODE(0, "quit", &resume,
2176+
N_("abort the patching operation but keep HEAD where it is."),
2177+
RESUME_QUIT),
2178+
OPT_CMDMODE(0, "show-current-patch", &resume,
2179+
N_("show the patch being applied."),
2180+
RESUME_SHOW_PATCH),
2181+
OPT_CMDMODE('r', "resolved", &resume,
2182+
N_("synonym for --continue"),
2183+
RESUME_RESOLVED),
21662184
OPT_BOOL('i', "interactive", &state.interactive,
21672185
N_("run interactively")),
21682186
OPT_HIDDEN_BOOL('b', "binary", &binary,
@@ -2221,24 +2239,6 @@ int cmd_am(int argc, const char **argv, const char *prefix)
22212239
PARSE_OPT_NOARG),
22222240
OPT_STRING(0, "resolvemsg", &state.resolvemsg, NULL,
22232241
N_("override error message when patch failure occurs")),
2224-
OPT_CMDMODE(0, "continue", &resume,
2225-
N_("continue applying patches after resolving a conflict"),
2226-
RESUME_RESOLVED),
2227-
OPT_CMDMODE('r', "resolved", &resume,
2228-
N_("synonyms for --continue"),
2229-
RESUME_RESOLVED),
2230-
OPT_CMDMODE(0, "skip", &resume,
2231-
N_("skip the current patch"),
2232-
RESUME_SKIP),
2233-
OPT_CMDMODE(0, "abort", &resume,
2234-
N_("restore the original branch and abort the patching operation."),
2235-
RESUME_ABORT),
2236-
OPT_CMDMODE(0, "quit", &resume,
2237-
N_("abort the patching operation but keep HEAD where it is."),
2238-
RESUME_QUIT),
2239-
OPT_CMDMODE(0, "show-current-patch", &resume,
2240-
N_("show the patch being applied."),
2241-
RESUME_SHOW_PATCH),
22422242
OPT_BOOL(0, "committer-date-is-author-date",
22432243
&state.committer_date_is_author_date,
22442244
N_("lie about committer date")),

builtin/merge.c

+6-6
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,12 @@ static int option_parse_n(const struct option *opt,
232232
}
233233

234234
static struct option builtin_merge_options[] = {
235+
OPT_BOOL(0, "continue", &continue_current_merge,
236+
N_("continue the current in-progress merge")),
237+
OPT_BOOL(0, "abort", &abort_current_merge,
238+
N_("abort the current in-progress merge")),
239+
OPT_BOOL(0, "quit", &quit_current_merge,
240+
N_("--abort but leave index and working tree alone")),
235241
{ OPTION_CALLBACK, 'n', NULL, NULL, NULL,
236242
N_("do not show a diffstat at the end of the merge"),
237243
PARSE_OPT_NOARG, option_parse_n },
@@ -265,12 +271,6 @@ static struct option builtin_merge_options[] = {
265271
N_("read message from file"), PARSE_OPT_NONEG,
266272
(parse_opt_cb *) option_read_message },
267273
OPT__VERBOSITY(&verbosity),
268-
OPT_BOOL(0, "abort", &abort_current_merge,
269-
N_("abort the current in-progress merge")),
270-
OPT_BOOL(0, "quit", &quit_current_merge,
271-
N_("--abort but leave index and working tree alone")),
272-
OPT_BOOL(0, "continue", &continue_current_merge,
273-
N_("continue the current in-progress merge")),
274274
OPT_BOOL(0, "allow-unrelated-histories", &allow_unrelated_histories,
275275
N_("allow merging unrelated histories")),
276276
OPT_SET_INT(0, "progress", &show_progress, N_("force progress reporting"), 1),

builtin/rebase.c

+14-14
Original file line numberDiff line numberDiff line change
@@ -1036,6 +1036,20 @@ int cmd_rebase(int argc, const char **argv, const char *prefix)
10361036
struct object_id squash_onto;
10371037
char *squash_onto_name = NULL;
10381038
struct option builtin_rebase_options[] = {
1039+
OPT_CMDMODE(0, "continue", &action, N_("continue"),
1040+
ACTION_CONTINUE),
1041+
OPT_CMDMODE(0, "skip", &action,
1042+
N_("skip current patch and continue"), ACTION_SKIP),
1043+
OPT_CMDMODE(0, "abort", &action,
1044+
N_("abort and check out the original branch"),
1045+
ACTION_ABORT),
1046+
OPT_CMDMODE(0, "quit", &action,
1047+
N_("abort but keep HEAD where it is"), ACTION_QUIT),
1048+
OPT_CMDMODE(0, "edit-todo", &action, N_("edit the todo list "
1049+
"during an interactive rebase"), ACTION_EDIT_TODO),
1050+
OPT_CMDMODE(0, "show-current-patch", &action,
1051+
N_("show the patch file being applied or merged"),
1052+
ACTION_SHOW_CURRENT_PATCH),
10391053
OPT_STRING(0, "onto", &options.onto_name,
10401054
N_("revision"),
10411055
N_("rebase onto given branch instead of upstream")),
@@ -1070,20 +1084,6 @@ int cmd_rebase(int argc, const char **argv, const char *prefix)
10701084
OPT_BIT(0, "no-ff", &options.flags,
10711085
N_("cherry-pick all commits, even if unchanged"),
10721086
REBASE_FORCE),
1073-
OPT_CMDMODE(0, "continue", &action, N_("continue"),
1074-
ACTION_CONTINUE),
1075-
OPT_CMDMODE(0, "skip", &action,
1076-
N_("skip current patch and continue"), ACTION_SKIP),
1077-
OPT_CMDMODE(0, "abort", &action,
1078-
N_("abort and check out the original branch"),
1079-
ACTION_ABORT),
1080-
OPT_CMDMODE(0, "quit", &action,
1081-
N_("abort but keep HEAD where it is"), ACTION_QUIT),
1082-
OPT_CMDMODE(0, "edit-todo", &action, N_("edit the todo list "
1083-
"during an interactive rebase"), ACTION_EDIT_TODO),
1084-
OPT_CMDMODE(0, "show-current-patch", &action,
1085-
N_("show the patch file being applied or merged"),
1086-
ACTION_SHOW_CURRENT_PATCH),
10871087
{ OPTION_CALLBACK, 'm', "merge", &options, NULL,
10881088
N_("use merging strategies to rebase"),
10891089
PARSE_OPT_NOARG | PARSE_OPT_NONEG,

0 commit comments

Comments
 (0)