Skip to content

Commit 806f7ac

Browse files
committed
help: show command mode options at the top
Show --continue/--skip etc. in a consistent order at the top of the help printed by -h. Signed-off-by: Phillip Wood <[email protected]>
1 parent e27cffb commit 806f7ac

File tree

4 files changed

+40
-40
lines changed

4 files changed

+40
-40
lines changed

builtin/am.c

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2170,6 +2170,24 @@ int cmd_am(int argc, const char **argv, const char *prefix)
21702170
};
21712171

21722172
struct option options[] = {
2173+
OPT_CMDMODE(0, "continue", &resume,
2174+
N_("continue applying patches after resolving a conflict"),
2175+
RESUME_RESOLVED),
2176+
OPT_CMDMODE(0, "skip", &resume,
2177+
N_("skip the current patch"),
2178+
RESUME_SKIP),
2179+
OPT_CMDMODE(0, "abort", &resume,
2180+
N_("restore the original branch and abort the patching operation."),
2181+
RESUME_ABORT),
2182+
OPT_CMDMODE(0, "quit", &resume,
2183+
N_("abort the patching operation but keep HEAD where it is."),
2184+
RESUME_QUIT),
2185+
OPT_CMDMODE(0, "show-current-patch", &resume,
2186+
N_("show the patch being applied."),
2187+
RESUME_SHOW_PATCH),
2188+
OPT_CMDMODE('r', "resolved", &resume,
2189+
N_("synonym for --continue"),
2190+
RESUME_RESOLVED),
21732191
OPT_BOOL('i', "interactive", &state.interactive,
21742192
N_("run interactively")),
21752193
OPT_HIDDEN_BOOL('b', "binary", &binary,
@@ -2228,24 +2246,6 @@ int cmd_am(int argc, const char **argv, const char *prefix)
22282246
PARSE_OPT_NOARG),
22292247
OPT_STRING(0, "resolvemsg", &state.resolvemsg, NULL,
22302248
N_("override error message when patch failure occurs")),
2231-
OPT_CMDMODE(0, "continue", &resume,
2232-
N_("continue applying patches after resolving a conflict"),
2233-
RESUME_RESOLVED),
2234-
OPT_CMDMODE('r', "resolved", &resume,
2235-
N_("synonyms for --continue"),
2236-
RESUME_RESOLVED),
2237-
OPT_CMDMODE(0, "skip", &resume,
2238-
N_("skip the current patch"),
2239-
RESUME_SKIP),
2240-
OPT_CMDMODE(0, "abort", &resume,
2241-
N_("restore the original branch and abort the patching operation."),
2242-
RESUME_ABORT),
2243-
OPT_CMDMODE(0, "quit", &resume,
2244-
N_("abort the patching operation but keep HEAD where it is."),
2245-
RESUME_QUIT),
2246-
OPT_CMDMODE(0, "show-current-patch", &resume,
2247-
N_("show the patch being applied."),
2248-
RESUME_SHOW_PATCH),
22492249
OPT_BOOL(0, "committer-date-is-author-date",
22502250
&state.committer_date_is_author_date,
22512251
N_("lie about committer date")),

builtin/merge.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,12 @@ static int option_parse_n(const struct option *opt,
239239
}
240240

241241
static struct option builtin_merge_options[] = {
242+
OPT_BOOL(0, "continue", &continue_current_merge,
243+
N_("continue the current in-progress merge")),
244+
OPT_BOOL(0, "abort", &abort_current_merge,
245+
N_("abort the current in-progress merge")),
246+
OPT_BOOL(0, "quit", &quit_current_merge,
247+
N_("--abort but leave index and working tree alone")),
242248
{ OPTION_CALLBACK, 'n', NULL, NULL, NULL,
243249
N_("do not show a diffstat at the end of the merge"),
244250
PARSE_OPT_NOARG, option_parse_n },
@@ -273,12 +279,6 @@ static struct option builtin_merge_options[] = {
273279
N_("read message from file"), PARSE_OPT_NONEG,
274280
NULL, 0, option_read_message },
275281
OPT__VERBOSITY(&verbosity),
276-
OPT_BOOL(0, "abort", &abort_current_merge,
277-
N_("abort the current in-progress merge")),
278-
OPT_BOOL(0, "quit", &quit_current_merge,
279-
N_("--abort but leave index and working tree alone")),
280-
OPT_BOOL(0, "continue", &continue_current_merge,
281-
N_("continue the current in-progress merge")),
282282
OPT_BOOL(0, "allow-unrelated-histories", &allow_unrelated_histories,
283283
N_("allow merging unrelated histories")),
284284
OPT_SET_INT(0, "progress", &show_progress, N_("force progress reporting"), 1),

builtin/rebase.c

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1386,6 +1386,20 @@ int cmd_rebase(int argc, const char **argv, const char *prefix)
13861386
struct object_id squash_onto;
13871387
char *squash_onto_name = NULL;
13881388
struct option builtin_rebase_options[] = {
1389+
OPT_CMDMODE(0, "continue", &action, N_("continue"),
1390+
ACTION_CONTINUE),
1391+
OPT_CMDMODE(0, "skip", &action,
1392+
N_("skip current patch and continue"), ACTION_SKIP),
1393+
OPT_CMDMODE(0, "abort", &action,
1394+
N_("abort and check out the original branch"),
1395+
ACTION_ABORT),
1396+
OPT_CMDMODE(0, "quit", &action,
1397+
N_("abort but keep HEAD where it is"), ACTION_QUIT),
1398+
OPT_CMDMODE(0, "edit-todo", &action, N_("edit the todo list "
1399+
"during an interactive rebase"), ACTION_EDIT_TODO),
1400+
OPT_CMDMODE(0, "show-current-patch", &action,
1401+
N_("show the patch file being applied or merged"),
1402+
ACTION_SHOW_CURRENT_PATCH),
13891403
OPT_STRING(0, "onto", &options.onto_name,
13901404
N_("revision"),
13911405
N_("rebase onto given branch instead of upstream")),
@@ -1420,20 +1434,6 @@ int cmd_rebase(int argc, const char **argv, const char *prefix)
14201434
OPT_BIT(0, "no-ff", &options.flags,
14211435
N_("cherry-pick all commits, even if unchanged"),
14221436
REBASE_FORCE),
1423-
OPT_CMDMODE(0, "continue", &action, N_("continue"),
1424-
ACTION_CONTINUE),
1425-
OPT_CMDMODE(0, "skip", &action,
1426-
N_("skip current patch and continue"), ACTION_SKIP),
1427-
OPT_CMDMODE(0, "abort", &action,
1428-
N_("abort and check out the original branch"),
1429-
ACTION_ABORT),
1430-
OPT_CMDMODE(0, "quit", &action,
1431-
N_("abort but keep HEAD where it is"), ACTION_QUIT),
1432-
OPT_CMDMODE(0, "edit-todo", &action, N_("edit the todo list "
1433-
"during an interactive rebase"), ACTION_EDIT_TODO),
1434-
OPT_CMDMODE(0, "show-current-patch", &action,
1435-
N_("show the patch file being applied or merged"),
1436-
ACTION_SHOW_CURRENT_PATCH),
14371437
{ OPTION_CALLBACK, 'm', "merge", &options, NULL,
14381438
N_("use merging strategies to rebase"),
14391439
PARSE_OPT_NOARG | PARSE_OPT_NONEG,

builtin/revert.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,10 +99,10 @@ static int run_sequencer(int argc, const char **argv, struct replay_opts *opts)
9999
const char *cleanup_arg = NULL;
100100
int cmd = 0;
101101
struct option base_options[] = {
102-
OPT_CMDMODE(0, "quit", &cmd, N_("end revert or cherry-pick sequence"), 'q'),
103102
OPT_CMDMODE(0, "continue", &cmd, N_("resume revert or cherry-pick sequence"), 'c'),
104-
OPT_CMDMODE(0, "abort", &cmd, N_("cancel revert or cherry-pick sequence"), 'a'),
105103
OPT_CMDMODE(0, "skip", &cmd, N_("skip current commit and continue"), 's'),
104+
OPT_CMDMODE(0, "abort", &cmd, N_("cancel revert or cherry-pick sequence"), 'a'),
105+
OPT_CMDMODE(0, "quit", &cmd, N_("end revert or cherry-pick sequence"), 'q'),
106106
OPT_CLEANUP(&cleanup_arg),
107107
OPT_BOOL('n', "no-commit", &opts->no_commit, N_("don't automatically commit")),
108108
OPT_BOOL('e', "edit", &opts->edit, N_("edit the commit message")),

0 commit comments

Comments
 (0)