parse-options: multi-word argh should use dash to separate words

"When you need to use space, use dash" is a strange way to say that you must not use a space. Because it is more common for the command line descriptions to use dashed-multi-words, you do not even want to use spaces in these places. Rephrase the documentation to avoid this strangeness. Fix a few existing multi-word argument help strings, i.e. - GPG key-ids given to -S/--gpg-sign are "key-id"; - Refs used for storing notes are "notes-ref"; and - Expiry timestamps given to --expire are "expiry-date". and update the corresponding documentation pages. Signed-off-by: Junio C Hamano <gitster@pobox.com>

Junio C Hamano committed Mar 23, 2014 at 15:58 UTC e703d7118c68bb5b1f850dae4060609a88500b18
13 files changed +24 -24
Documentation/git-cherry-pick.txt
+3 -3
@@ -9,7 +9,7 @@ SYNOPSIS
9 --------
10 [verse]
11 'git cherry-pick' [--edit] [-n] [-m parent-number] [-s] [-x] [--ff]
12 - [-S[<keyid>]] <commit>...
12 + [-S[<key-id>]] <commit>...
13 'git cherry-pick' --continue
14 'git cherry-pick' --quit
15 'git cherry-pick' --abort
@@ -101,8 +101,8 @@ effect to your index in a row.
101 --signoff::
102 Add Signed-off-by line at the end of the commit message.
103
104 --S[<keyid>]::
105 ---gpg-sign[=<keyid>]::
104 +-S[<key-id>]::
105 +--gpg-sign[=<key-id>]::
106 GPG-sign commits.
107
108 --ff::
Documentation/git-commit.txt
+1 -1
@@ -13,7 +13,7 @@ SYNOPSIS
13 [-F <file> | -m <msg>] [--reset-author] [--allow-empty]
14 [--allow-empty-message] [--no-verify] [-e] [--author=<author>]
15 [--date=<date>] [--cleanup=<mode>] [--[no-]status]
16 - [-i | -o] [-S[<keyid>]] [--] [<file>...]
16 + [-i | -o] [-S[<key-id>]] [--] [<file>...]
17
18 DESCRIPTION
19 -----------
Documentation/git-merge.txt
+1 -1
@@ -10,7 +10,7 @@ SYNOPSIS
10 --------
11 [verse]
12 'git merge' [-n] [--stat] [--no-commit] [--squash] [--[no-]edit]
13 - [-s <strategy>] [-X <strategy-option>] [-S[<keyid>]]
13 + [-s <strategy>] [-X <strategy-option>] [-S[<key-id>]]
14 [--[no-]rerere-autoupdate] [-m <msg>] [<commit>...]
15 'git merge' <msg> HEAD <commit>...
16 'git merge' --abort
Documentation/git-notes.txt
+1 -1
@@ -14,7 +14,7 @@ SYNOPSIS
14 'git notes' append [-F <file> | -m <msg> | (-c | -C) <object>] [<object>]
15 'git notes' edit [<object>]
16 'git notes' show [<object>]
17 -'git notes' merge [-v | -q] [-s <strategy> ] <notes_ref>
17 +'git notes' merge [-v | -q] [-s <strategy> ] <notes-ref>
18 'git notes' merge --commit [-v | -q]
19 'git notes' merge --abort [-v | -q]
20 'git notes' remove [--ignore-missing] [--stdin] [<object>...]
Documentation/git-rev-parse.txt
+8 -8
@@ -290,14 +290,14 @@ The lines after the separator describe the options.
290 Each line of options has this format:
291
292 ------------
293 -<opt_spec><flags>*<arg_hint>? SP+ help LF
293 +<opt-spec><flags>*<arg-hint>? SP+ help LF
294 ------------
295
296 -`<opt_spec>`::
296 +`<opt-spec>`::
297 its format is the short option character, then the long option name
298 separated by a comma. Both parts are not required, though at least one
299 is necessary. `h,help`, `dry-run` and `f` are all three correct
300 - `<opt_spec>`.
300 + `<opt-spec>`.
301
302 `<flags>`::
303 `<flags>` are of `*`, `=`, `?` or `!`.
@@ -313,11 +313,11 @@ Each line of options has this format:
313
314 * Use `!` to not make the corresponding negated long option available.
315
316 -`<arg_hint>`::
317 - `<arg_hint>`, if specified, is used as a name of the argument in the
318 - help output, for options that take arguments. `<arg_hint>` is
319 - terminated by the first whitespace. When you need to use space in the
320 - argument hint use dash instead.
316 +`<arg-hint>`::
317 + `<arg-hint>`, if specified, is used as a name of the argument in the
318 + help output, for options that take arguments. `<arg-hint>` is
319 + terminated by the first whitespace. It is customary to use a
320 + dash to separate words in a multi-word argument hint.
321
322 The remainder of the line, after stripping the spaces, is used
323 as the help associated to the option.
Documentation/git-revert.txt
+3 -3
@@ -8,7 +8,7 @@ git-revert - Revert some existing commits
8 SYNOPSIS
9 --------
10 [verse]
11 -'git revert' [--[no-]edit] [-n] [-m parent-number] [-s] [-S[<keyid>]] <commit>...
11 +'git revert' [--[no-]edit] [-n] [-m parent-number] [-s] [-S[<key-id>]] <commit>...
12 'git revert' --continue
13 'git revert' --quit
14 'git revert' --abort
@@ -80,8 +80,8 @@ more details.
80 This is useful when reverting more than one commits'
81 effect to your index in a row.
82
83 --S[<keyid>]::
84 ---gpg-sign[=<keyid>]::
83 +-S[<key-id>]::
84 +--gpg-sign[=<key-id>]::
85 GPG-sign commits.
86
87 -s::
builtin/checkout.c
+1 -1
@@ -1095,7 +1095,7 @@ int cmd_checkout(int argc, const char **argv, const char *prefix)
1095 OPT_BOOL(0, "detach", &opts.force_detach, N_("detach the HEAD at named commit")),
1096 OPT_SET_INT('t', "track", &opts.track, N_("set upstream info for new branch"),
1097 BRANCH_TRACK_EXPLICIT),
1098 - OPT_STRING(0, "orphan", &opts.new_orphan_branch, N_("new branch"), N_("new unparented branch")),
1098 + OPT_STRING(0, "orphan", &opts.new_orphan_branch, N_("new-branch"), N_("new unparented branch")),
1099 OPT_SET_INT('2', "ours", &opts.writeout_stage, N_("checkout our version for unmerged files"),
1100 2),
1101 OPT_SET_INT('3', "theirs", &opts.writeout_stage, N_("checkout their version for unmerged files"),
builtin/commit.c
+1 -1
@@ -1472,7 +1472,7 @@ int cmd_commit(int argc, const char **argv, const char *prefix)
1472 OPT_BOOL('e', "edit", &edit_flag, N_("force edit of commit")),
1473 OPT_STRING(0, "cleanup", &cleanup_arg, N_("default"), N_("how to strip spaces and #comments from message")),
1474 OPT_BOOL(0, "status", &include_status, N_("include status in commit message template")),
1475 - { OPTION_STRING, 'S', "gpg-sign", &sign_commit, N_("key id"),
1475 + { OPTION_STRING, 'S', "gpg-sign", &sign_commit, N_("key-id"),
1476 N_("GPG sign commit"), PARSE_OPT_OPTARG, NULL, (intptr_t) "" },
1477 /* end commit message options */
1478
builtin/merge.c
+1 -1
@@ -220,7 +220,7 @@ static struct option builtin_merge_options[] = {
220 OPT_BOOL(0, "abort", &abort_current_merge,
221 N_("abort the current in-progress merge")),
222 OPT_SET_INT(0, "progress", &show_progress, N_("force progress reporting"), 1),
223 - { OPTION_STRING, 'S', "gpg-sign", &sign_commit, N_("key id"),
223 + { OPTION_STRING, 'S', "gpg-sign", &sign_commit, N_("key-id"),
224 N_("GPG sign commit"), PARSE_OPT_OPTARG, NULL, (intptr_t) "" },
225 OPT_BOOL(0, "overwrite-ignore", &overwrite_ignore, N_("update ignored files (default)")),
226 OPT_END()
builtin/notes.c
+1 -1
@@ -939,7 +939,7 @@ int cmd_notes(int argc, const char **argv, const char *prefix)
939 int result;
940 const char *override_notes_ref = NULL;
941 struct option options[] = {
942 - OPT_STRING(0, "ref", &override_notes_ref, N_("notes_ref"),
942 + OPT_STRING(0, "ref", &override_notes_ref, N_("notes-ref"),
943 N_("use notes from <notes_ref>")),
944 OPT_END()
945 };
builtin/revert.c
+1 -1
@@ -89,7 +89,7 @@ static void parse_args(int argc, const char **argv, struct replay_opts *opts)
89 OPT_STRING(0, "strategy", &opts->strategy, N_("strategy"), N_("merge strategy")),
90 OPT_CALLBACK('X', "strategy-option", &opts, N_("option"),
91 N_("option for merge strategy"), option_parse_x),
92 - { OPTION_STRING, 'S', "gpg-sign", &opts->gpg_sign, N_("key id"),
92 + { OPTION_STRING, 'S', "gpg-sign", &opts->gpg_sign, N_("key-id"),
93 N_("GPG sign commit"), PARSE_OPT_OPTARG, NULL, (intptr_t) "" },
94 OPT_END(),
95 OPT_END(),
builtin/tag.c
+1 -1
@@ -513,7 +513,7 @@ int cmd_tag(int argc, const char **argv, const char *prefix)
513 OPT_BOOL('s', "sign", &opt.sign, N_("annotated and GPG-signed tag")),
514 OPT_STRING(0, "cleanup", &cleanup_arg, N_("mode"),
515 N_("how to strip spaces and #comments from message")),
516 - OPT_STRING('u', "local-user", &keyid, N_("key id"),
516 + OPT_STRING('u', "local-user", &keyid, N_("key-id"),
517 N_("use another key to sign the tag")),
518 OPT__FORCE(&force, N_("replace the tag if exists")),
519 OPT_COLUMN(0, "column", &colopts, N_("show tag list in columns")),
parse-options.h
+1 -1
@@ -143,7 +143,7 @@ struct option {
143 { OPTION_CALLBACK, (s), (l), (v), N_("time"),(h), 0, \
144 parse_opt_approxidate_cb }
145 #define OPT_EXPIRY_DATE(s, l, v, h) \
146 - { OPTION_CALLBACK, (s), (l), (v), N_("expiry date"),(h), 0, \
146 + { OPTION_CALLBACK, (s), (l), (v), N_("expiry-date"),(h), 0, \
147 parse_opt_expiry_date_cb }
148 #define OPT_CALLBACK(s, l, v, a, h, f) \
149 { OPTION_CALLBACK, (s), (l), (v), (a), (h), 0, (f) }