int whichArg = 0;
String groupName = "repGroup";
String host = "localHost";
String nodeName = "node8";
long startLsn = DbLsn.NULL_LSN;
VLSN startVLSN = VLSN.NULL_VLSN;
boolean verbose = true;
boolean forward = true;
/* Default to looking in current directory. */
File envHome = new File(".");
Key.DUMP_TYPE = DumpType.BINARY;
while (whichArg < argv.length) {
String nextArg = argv[whichArg];
if (nextArg.equals("-h")) {
whichArg++;
envHome = new File(CmdUtil.getArg(argv, whichArg));
} else if (nextArg.equals("-s")) {
whichArg++;
String arg = CmdUtil.getArg(argv, whichArg);
int slashOff = arg.indexOf("/");
if (slashOff < 0) {
long startFileNum = CmdUtil.readLongNumber(arg);
startLsn = DbLsn.makeLsn(startFileNum, 0);
} else {
long startFileNum =
CmdUtil.readLongNumber(arg.substring(0, slashOff));
long startOffset = CmdUtil.readLongNumber
(arg.substring(slashOff + 1));
startLsn = DbLsn.makeLsn(startFileNum, startOffset);
}
} else if (nextArg.equals("-e")) {
whichArg++;
String arg = CmdUtil.getArg(argv, whichArg);
int slashOff = arg.indexOf("/");
/* SuppressWarnings because -e is not yet implemented.*/
if (slashOff < 0) {
@SuppressWarnings("unused")
long endFileNum = CmdUtil.readLongNumber(arg);
} else {
@SuppressWarnings("unused")
long endFileNum =
CmdUtil.readLongNumber(arg.substring(0, slashOff));
@SuppressWarnings("unused")
long endOffset = CmdUtil.readLongNumber
(arg.substring(slashOff + 1));
}
} else if (nextArg.equals("-q")) {
verbose = false;
} else if (nextArg.equals("-backward")) {
forward = false;
} else if (nextArg.equals("-vlsn")) {
whichArg++;
String arg = CmdUtil.getArg(argv, whichArg);
startVLSN = new VLSN(CmdUtil.readLongNumber(arg));
} else {
System.err.println
(nextArg + " is not a supported option.");
usage();
System.exit(-1);