manifest_dump: Fix the help message and make it consistent

Summary: ldb uses --output_hex so make manifest_dump do the same thing.

Test Plan:
[zshao@dev485 ~/git/rocksdb] ./manifest_dump --output_hex --file=/data/users/zshao/test_leveldb/MANIFEST-000034
manifest_file_number 42 next_file_number 43 last_sequence 2311567 log_number 36  prev_log_number 0
--- level 0 --- version# 0 ---
--- level 1 --- version# 0 ---
--- level 2 --- version# 0 ---
--- level 3 --- version# 0 ---
 5:27788699['0000027F4FBE0000' @ 1 : 1 .. '11CE749602C90000' @ 160642 : 1]
 7:27785313['11CE773DA7E00000' @ 160643 : 1 .. '23A4C63EC55D0000' @ 321094 : 1]
 9:27784288['23A4D581FCD30000' @ 321095 : 1 .. '3576291D12D00000' @ 481428 : 1]
 38:64378271['35762BF0E0CE0000' @ 481429 : 1 .. '5E987E0604700000' @ 852910 : 1]
 39:64379046['5E987EB0BDD50000' @ 852911 : 1 .. '87C954330E840000' @ 1224603 : 1]
 40:10169201['87C95507E49C0000' @ 1224604 : 1 .. '8E48DC0933B70000' @ 1283317 : 1]
 21:27798825['8E48DFB0D7CE0000' @ 1283318 : 1 .. 'A00675F8AD7E0000' @ 1443826 : 1]
 23:27793751['A006777536E30000' @ 1443827 : 1 .. 'B1D1787FE8670000' @ 1604553 : 1]
 25:27801659['B1D179289BB30000' @ 1604554 : 1 .. 'C396D3A69DCE0000' @ 1765012 : 1]
 27:27792661['C396DA1E03B10000' @ 1765013 : 1 .. 'D55C9974FCC10000' @ 1925513 : 1]
 29:27789095['D55C9B47CBC00000' @ 1925514 : 1 .. 'E71F67D11CCC0000' @ 2085789 : 1]
 31:27793145['E71F7A667E740000' @ 2085790 : 1 .. 'F8D4712EF3D90000' @ 2246454 : 1]
 41:11246031['F8D4715916A70000' @ 2246455 : 1 .. 'FFFFFCAE97DF0000' @ 2311567 : 1]
--- level 4 --- version# 0 ---
--- level 5 --- version# 0 ---
--- level 6 --- version# 0 ---

Reviewers: dhruba, sheki, emayanke

Reviewed By: dhruba

CC: leveldb

Differential Revision: https://reviews.facebook.net/D7575
main
Zheng Shao 12 years ago
parent 01d57a33fe
commit 127ee2e677
  1. 18
      tools/manifest_dump.cc

@ -19,7 +19,7 @@
#include "util/logging.h"
static int verbose = 0;
static int hex = 0;
static int output_hex = 0;
using namespace leveldb;
@ -41,14 +41,18 @@ int main(int argc, char** argv) {
} else if (sscanf(argv[i], "--verbose=%ld%c", &n, &junk) == 1 &&
(n == 0 || n == 1)) {
verbose = n;
} else if (sscanf(argv[i], "--hex=%ld%c", &n, &junk) == 1 &&
(n == 0 || n == 1)) {
hex = n;
} else if (param == "--output_hex") {
output_hex = n;
} else {
fprintf(stderr, "Unknown or badly-formatted option: %s\n",
argv[i]);
abort();
}
}
if (!foundfile) {
fprintf(stderr, "%s [--verbose=0|1] [--file=pathname of manifest file\n",
argv[0]);
fprintf(stderr,
"%s [--verbose=0|1] [--output_hex] [--file=pathname of manifest file]\n",
argv[0]);
abort();
}
@ -64,7 +68,7 @@ int main(int argc, char** argv) {
VersionSet* versions = new VersionSet(dbname, &options,
tc, cmp);
Status s = versions->DumpManifest(options, file, verbose, hex);
Status s = versions->DumpManifest(options, file, verbose, output_hex);
if (!s.ok()) {
printf("Error in processing file %s %s\n", manifestfile.c_str(),
s.ToString().c_str());

Loading…
Cancel
Save