return false;
}
if (commandLine.hasOption("filename") && commandLine.hasOption("dirname")) {
throw new ParseException(
"--filename and --dirname options cannot be used simultaneously");
}
if (!commandLine.hasOption("port") && !commandLine.hasOption("host") &&
!commandLine.hasOption("rpcProps")) {
throw new ParseException("Either --rpcProps or both --host and --port " +
"must be specified.");
}
if (commandLine.hasOption("rpcProps")) {
rpcClientPropsFile = commandLine.getOptionValue("rpcProps");
Preconditions.checkNotNull(rpcClientPropsFile, "RPC client properties " +
"file must be specified after --rpcProps argument.");
Preconditions.checkArgument(new File(rpcClientPropsFile).exists(),
"RPC client properties file %s does not exist!", rpcClientPropsFile);
}
if (rpcClientPropsFile == null) {
if (!commandLine.hasOption("port")) {
throw new ParseException(
"You must specify a port to connect to with --port");
}
port = Integer.parseInt(commandLine.getOptionValue("port"));
if (!commandLine.hasOption("host")) {
throw new ParseException(
"You must specify a hostname to connect to with --host");
}
hostname = commandLine.getOptionValue("host");
}