git-tag: introduce long forms for the options

Long forms are better to memorize and more reliably uniform across commands. Design notes: -u,--local-user is named following the analogous gnupg option. -l,--list is not an argument taking option but a mode switch. Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Michael J Gruber committed Aug 28, 2011 at 16:54 UTC c97eff5a95d57a9561b7c7429e7fcc5d0e3a7f5d
2 files changed +21 -10
Documentation/git-tag.txt
+13 -2
@@ -43,12 +43,15 @@ GnuPG key for signing.
43 OPTIONS
44 -------
45 -a::
46 +--annotate::
47 Make an unsigned, annotated tag object
48
49 -s::
50 +--sign::
51 Make a GPG-signed tag, using the default e-mail address's key
52
53 -u <key-id>::
54 +--local-user=<key-id>::
55 Make a GPG-signed tag, using the given key
56
57 -f::
@@ -56,9 +59,11 @@ OPTIONS
59 Replace an existing tag with the given name (instead of failing)
60
61 -d::
62 +--delete::
63 Delete existing tags with the given names.
64
65 -v::
66 +--verify::
67 Verify the gpg signature of the given tag names.
68
69 -n<num>::
@@ -69,13 +74,18 @@ OPTIONS
74 If the tag is not annotated, the commit message is displayed instead.
75
76 -l <pattern>::
72 - List tags with names that match the given pattern (or all if no pattern is given).
73 - Typing "git tag" without arguments, also lists all tags.
77 +--list <pattern>::
78 + List tags with names that match the given pattern (or all if no
79 + pattern is given). Running "git tag" without arguments also
80 + lists all tags. The pattern is a shell wildcard (i.e., matched
81 + using fnmatch(3)). Multiple patterns may be given; if any of
82 + them matches, the tag is shown.
83
84 --contains <commit>::
85 Only list tags which contain the specified commit.
86
87 -m <msg>::
88 +--message=<msg>::
89 Use the given tag message (instead of prompting).
90 If multiple `-m` options are given, their values are
91 concatenated as separate paragraphs.
@@ -83,6 +93,7 @@ OPTIONS
93 is given.
94
95 -F <file>::
96 +--file=<file>::
97 Take the tag message from the given file. Use '-' to
98 read the message from the standard input.
99 Implies `-a` if none of `-a`, `-s`, or `-u <key-id>`
builtin/tag.c
+8 -8
@@ -377,21 +377,21 @@ int cmd_tag(int argc, const char **argv, const char *prefix)
377 struct msg_arg msg = { 0, STRBUF_INIT };
378 struct commit_list *with_commit = NULL;
379 struct option options[] = {
380 - OPT_BOOLEAN('l', NULL, &list, "list tag names"),
380 + OPT_BOOLEAN('l', "list", &list, "list tag names"),
381 { OPTION_INTEGER, 'n', NULL, &lines, "n",
382 "print <n> lines of each tag message",
383 PARSE_OPT_OPTARG, NULL, 1 },
384 - OPT_BOOLEAN('d', NULL, &delete, "delete tags"),
385 - OPT_BOOLEAN('v', NULL, &verify, "verify tags"),
384 + OPT_BOOLEAN('d', "delete", &delete, "delete tags"),
385 + OPT_BOOLEAN('v', "verify", &verify, "verify tags"),
386
387 OPT_GROUP("Tag creation options"),
388 - OPT_BOOLEAN('a', NULL, &annotate,
388 + OPT_BOOLEAN('a', "annotate", &annotate,
389 "annotated tag, needs a message"),
390 - OPT_CALLBACK('m', NULL, &msg, "message",
390 + OPT_CALLBACK('m', "message", &msg, "message",
391 "tag message", parse_msg_arg),
392 - OPT_FILENAME('F', NULL, &msgfile, "read message from file"),
393 - OPT_BOOLEAN('s', NULL, &sign, "annotated and GPG-signed tag"),
394 - OPT_STRING('u', NULL, &keyid, "key-id",
392 + OPT_FILENAME('F', "file", &msgfile, "read message from file"),
393 + OPT_BOOLEAN('s', "sign", &sign, "annotated and GPG-signed tag"),
394 + OPT_STRING('u', "local-user", &keyid, "key-id",
395 "use another key to sign the tag"),
396 OPT__FORCE(&force, "replace the tag if exists"),
397