Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephen Boyd <bebarino@gmail.com>2009-07-08 09:15:39 +0400
committerJunio C Hamano <gitster@pobox.com>2009-07-11 10:57:15 +0400
commit4855b2a220cacb01b77a2bf431b5b176bfa1d732 (patch)
tree86a3deef2f346d02bc0c62b24de0673205b8621b /builtin-verify-tag.c
parent404d42e5efe05ef8dd40713e00001746a060b66b (diff)
verify-tag: migrate to parse-options
Signed-off-by: Stephen Boyd <bebarino@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin-verify-tag.c')
-rw-r--r--builtin-verify-tag.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/builtin-verify-tag.c b/builtin-verify-tag.c
index 7f7fda42f9..9f482c29f5 100644
--- a/builtin-verify-tag.c
+++ b/builtin-verify-tag.c
@@ -10,9 +10,12 @@
#include "tag.h"
#include "run-command.h"
#include <signal.h>
+#include "parse-options.h"
-static const char builtin_verify_tag_usage[] =
- "git verify-tag [-v|--verbose] <tag>...";
+static const char * const verify_tag_usage[] = {
+ "git verify-tag [-v|--verbose] <tag>...",
+ NULL
+};
#define PGP_SIGNATURE "-----BEGIN PGP SIGNATURE-----"
@@ -89,17 +92,17 @@ static int verify_tag(const char *name, int verbose)
int cmd_verify_tag(int argc, const char **argv, const char *prefix)
{
int i = 1, verbose = 0, had_error = 0;
+ const struct option verify_tag_options[] = {
+ OPT__VERBOSE(&verbose),
+ OPT_END()
+ };
git_config(git_default_config, NULL);
- if (argc > 1 &&
- (!strcmp(argv[i], "-v") || !strcmp(argv[i], "--verbose"))) {
- verbose = 1;
- i++;
- }
-
+ argc = parse_options(argc, argv, prefix, verify_tag_options,
+ verify_tag_usage, PARSE_OPT_KEEP_ARGV0);
if (argc <= i)
- usage(builtin_verify_tag_usage);
+ usage_with_options(verify_tag_usage, verify_tag_options);
/* sometimes the program was terminated because this signal
* was received in the process of writing the gpg input: */