Running ./ldb without any extra arg print usage (#7107)

Summary:
as title.

Pull Request resolved: https://github.com/facebook/rocksdb/pull/7107

Test Plan: make ldb && ./ldb

Reviewed By: pdillinger

Differential Revision: D22451399

Pulled By: riversand963

fbshipit-source-id: 797645e06473bb9cf139c533877e5161281515e8
This commit is contained in:
Yanqin Jin 2020-07-09 10:18:52 -07:00 committed by Facebook GitHub Bot
parent b35a2f9146
commit 842bd2742a
2 changed files with 5 additions and 2 deletions

View File

@ -107,7 +107,10 @@ int LDBCommandRunner::RunCommand(
const LDBOptions& ldb_options, const LDBOptions& ldb_options,
const std::vector<ColumnFamilyDescriptor>* column_families) { const std::vector<ColumnFamilyDescriptor>* column_families) {
if (argc <= 2) { if (argc <= 2) {
if (std::string(argv[1]) == "--version") { if (argc <= 1) {
PrintHelp(ldb_options, argv[0], /*to_stderr*/ true);
return 1;
} else if (std::string(argv[1]) == "--version") {
printf("ldb from RocksDB %d.%d.%d\n", ROCKSDB_MAJOR, ROCKSDB_MINOR, printf("ldb from RocksDB %d.%d.%d\n", ROCKSDB_MAJOR, ROCKSDB_MINOR,
ROCKSDB_PATCH); ROCKSDB_PATCH);
return 0; return 0;