summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 4855b2a)
raw | patch | inline | side by side (parent: 4855b2a)
author | Stephen Boyd <bebarino@gmail.com> | |
Wed, 8 Jul 2009 05:15:40 +0000 (22:15 -0700) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Sat, 11 Jul 2009 06:57:20 +0000 (23:57 -0700) |
OPT__VERBOSE introduces the long option (--verbose) in addition to the
already present short option (-v), so document this new addition.
Signed-off-by: Stephen Boyd <bebarino@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
already present short option (-v), so document this new addition.
Signed-off-by: Stephen Boyd <bebarino@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/git-verify-pack.txt | patch | blob | history | |
builtin-verify-pack.c | patch | blob | history |
index c8611632d1d501d57eb7000de0ec3c3b36810b80..d791a80819b39b5c3b07ace9d30f16c63f56fd2e 100644 (file)
SYNOPSIS
--------
-'git verify-pack' [-v] [--] <pack>.idx ...
+'git verify-pack' [-v|--verbose] [--] <pack>.idx ...
DESCRIPTION
The idx files to verify.
-v::
+--verbose::
After verifying the pack, show list of objects contained
in the pack.
\--::
diff --git a/builtin-verify-pack.c b/builtin-verify-pack.c
index 0ee0a9af60b0601fe0e6db98ec582e059f5e9064..ebd6dff94010ae8cfe4a90abeedb173e1bedaf8c 100644 (file)
--- a/builtin-verify-pack.c
+++ b/builtin-verify-pack.c
#include "cache.h"
#include "pack.h"
#include "pack-revindex.h"
+#include "parse-options.h"
#define MAX_CHAIN 50
return err;
}
-static const char verify_pack_usage[] = "git verify-pack [-v] <pack>...";
+static const char * const verify_pack_usage[] = {
+ "git verify-pack [-v|--verbose] <pack>...",
+ NULL
+};
int cmd_verify_pack(int argc, const char **argv, const char *prefix)
{
int err = 0;
int verbose = 0;
- int no_more_options = 0;
- int nothing_done = 1;
+ int i;
+ const struct option verify_pack_options[] = {
+ OPT__VERBOSE(&verbose),
+ OPT_END()
+ };
git_config(git_default_config, NULL);
- while (1 < argc) {
- if (!no_more_options && argv[1][0] == '-') {
- if (!strcmp("-v", argv[1]))
- verbose = 1;
- else if (!strcmp("--", argv[1]))
- no_more_options = 1;
- else
- usage(verify_pack_usage);
- }
- else {
- if (verify_one_pack(argv[1], verbose))
- err = 1;
- discard_revindex();
- nothing_done = 0;
- }
- argc--; argv++;
+ argc = parse_options(argc, argv, prefix, verify_pack_options,
+ verify_pack_usage, 0);
+ if (argc < 1)
+ usage_with_options(verify_pack_usage, verify_pack_options);
+ for (i = 0; i < argc; i++) {
+ if (verify_one_pack(argv[i], verbose))
+ err = 1;
+ discard_revindex();
}
- if (nothing_done)
- usage(verify_pack_usage);
-
return err;
}