|
|
|
@ -12,10 +12,11 @@ namespace rocksdb { |
|
|
|
|
|
|
|
|
|
LDBOptions::LDBOptions() {} |
|
|
|
|
|
|
|
|
|
void LDBCommandRunner::PrintHelp(const char* exec_name) { |
|
|
|
|
void LDBCommandRunner::PrintHelp(const LDBOptions& ldb_options, |
|
|
|
|
const char* exec_name) { |
|
|
|
|
std::string ret; |
|
|
|
|
|
|
|
|
|
ret.append("ldb - LevelDB Tool"); |
|
|
|
|
ret.append(ldb_options.print_help_header); |
|
|
|
|
ret.append("\n\n"); |
|
|
|
|
ret.append("commands MUST specify --" + LDBCommand::ARG_DB + |
|
|
|
|
"=<full_path_to_db_directory> when necessary\n"); |
|
|
|
@ -91,7 +92,7 @@ void LDBCommandRunner::RunCommand( |
|
|
|
|
int argc, char** argv, Options options, const LDBOptions& ldb_options, |
|
|
|
|
const std::vector<ColumnFamilyDescriptor>* column_families) { |
|
|
|
|
if (argc <= 2) { |
|
|
|
|
PrintHelp(argv[0]); |
|
|
|
|
PrintHelp(ldb_options, argv[0]); |
|
|
|
|
exit(1); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -99,7 +100,7 @@ void LDBCommandRunner::RunCommand( |
|
|
|
|
argc, argv, options, ldb_options, column_families); |
|
|
|
|
if (cmdObj == nullptr) { |
|
|
|
|
fprintf(stderr, "Unknown command\n"); |
|
|
|
|
PrintHelp(argv[0]); |
|
|
|
|
PrintHelp(ldb_options, argv[0]); |
|
|
|
|
exit(1); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|