|
10 | 10 | #include "tag.h"
|
11 | 11 | #include "run-command.h"
|
12 | 12 | #include <signal.h>
|
| 13 | +#include "parse-options.h" |
13 | 14 |
|
14 |
| -static const char builtin_verify_tag_usage[] = |
15 |
| - "git verify-tag [-v|--verbose] <tag>..."; |
| 15 | +static const char * const verify_tag_usage[] = { |
| 16 | + "git verify-tag [-v|--verbose] <tag>...", |
| 17 | + NULL |
| 18 | +}; |
16 | 19 |
|
17 | 20 | #define PGP_SIGNATURE "-----BEGIN PGP SIGNATURE-----"
|
18 | 21 |
|
@@ -89,17 +92,17 @@ static int verify_tag(const char *name, int verbose)
|
89 | 92 | int cmd_verify_tag(int argc, const char **argv, const char *prefix)
|
90 | 93 | {
|
91 | 94 | int i = 1, verbose = 0, had_error = 0;
|
| 95 | + const struct option verify_tag_options[] = { |
| 96 | + OPT__VERBOSE(&verbose), |
| 97 | + OPT_END() |
| 98 | + }; |
92 | 99 |
|
93 | 100 | git_config(git_default_config, NULL);
|
94 | 101 |
|
95 |
| - if (argc > 1 && |
96 |
| - (!strcmp(argv[i], "-v") || !strcmp(argv[i], "--verbose"))) { |
97 |
| - verbose = 1; |
98 |
| - i++; |
99 |
| - } |
100 |
| - |
| 102 | + argc = parse_options(argc, argv, prefix, verify_tag_options, |
| 103 | + verify_tag_usage, PARSE_OPT_KEEP_ARGV0); |
101 | 104 | if (argc <= i)
|
102 |
| - usage(builtin_verify_tag_usage); |
| 105 | + usage_with_options(verify_tag_usage, verify_tag_options); |
103 | 106 |
|
104 | 107 | /* sometimes the program was terminated because this signal
|
105 | 108 | * was received in the process of writing the gpg input: */
|
|
0 commit comments