From 168f32eb10c2c974ebdfb04dcfc48ef9f7c959b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Scharfe?= Date: Sun, 19 Aug 2018 19:34:35 +0200 Subject: checkout-index: improve argument help for --stage Spell out all alternatives and avoid using a numerical range operator, as it is not mentioned in CodingGuidelines and the resulting string is still concise. Wrap them in parentheses to document clearly that the "--stage=" part is common among them. Signed-off-by: Rene Scharfe Signed-off-by: Junio C Hamano diff --git a/builtin/checkout-index.c b/builtin/checkout-index.c index a730f6a..92e9d0d 100644 --- a/builtin/checkout-index.c +++ b/builtin/checkout-index.c @@ -172,7 +172,7 @@ int cmd_checkout_index(int argc, const char **argv, const char *prefix) N_("write the content to temporary files")), OPT_STRING(0, "prefix", &state.base_dir, N_("string"), N_("when creating files, prepend ")), - { OPTION_CALLBACK, 0, "stage", NULL, "1-3|all", + { OPTION_CALLBACK, 0, "stage", NULL, "(1|2|3|all)", N_("copy out the files from named stage"), PARSE_OPT_NONEG, option_parse_stage }, OPT_END() -- cgit v0.10.2-6-g49f6 From 446e63ccf536782263be3659d41b6c603c851bce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Scharfe?= Date: Sun, 19 Aug 2018 19:34:43 +0200 Subject: remote: improve argument help for add --mirror Group the possible values using a pair of parentheses and don't mark them for translation, as they are literal strings that have to be used as-is in any locale. Signed-off-by: Rene Scharfe Signed-off-by: Junio C Hamano diff --git a/builtin/remote.c b/builtin/remote.c index 1a82d85..4f95d21 100644 --- a/builtin/remote.c +++ b/builtin/remote.c @@ -167,7 +167,7 @@ static int add(int argc, const char **argv) OPT_STRING_LIST('t', "track", &track, N_("branch"), N_("branch(es) to track")), OPT_STRING('m', "master", &master, N_("branch"), N_("master branch")), - { OPTION_CALLBACK, 0, "mirror", &mirror, N_("push|fetch"), + { OPTION_CALLBACK, 0, "mirror", &mirror, "(push|fetch)", N_("set up remote as a mirror to push to or fetch from"), PARSE_OPT_OPTARG | PARSE_OPT_COMP_ARG, parse_mirror_opt }, OPT_END() -- cgit v0.10.2-6-g49f6 From bbc072f5d884d17a6102fd04ae6d2cfcaa98ad48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Scharfe?= Date: Sun, 19 Aug 2018 19:34:48 +0200 Subject: parseopt: group literal string alternatives in argument help This formally clarifies that the "--option=" part is the same for all alternatives. Signed-off-by: Rene Scharfe Signed-off-by: Junio C Hamano diff --git a/builtin/pull.c b/builtin/pull.c index 49cc3be..6eebb24 100644 --- a/builtin/pull.c +++ b/builtin/pull.c @@ -135,7 +135,7 @@ static struct option pull_options[] = { /* Options passed to git-merge or git-rebase */ OPT_GROUP(N_("Options related to merging")), { OPTION_CALLBACK, 'r', "rebase", &opt_rebase, - "false|true|merges|preserve|interactive", + "(false|true|merges|preserve|interactive)", N_("incorporate changes by rebasing rather than merging"), PARSE_OPT_OPTARG, parse_opt_rebase }, OPT_PASSTHRU('n', NULL, &opt_diffstat, NULL, diff --git a/builtin/push.c b/builtin/push.c index 9cd8e8c..b5a941c 100644 --- a/builtin/push.c +++ b/builtin/push.c @@ -561,7 +561,7 @@ int cmd_push(int argc, const char **argv, const char *prefix) 0, CAS_OPT_NAME, &cas, N_("refname>: