From 842bd2742ae018ce7fa33fb22b706022712bb1cf Mon Sep 17 00:00:00 2001 From: Yanqin Jin Date: Thu, 9 Jul 2020 10:18:52 -0700 Subject: [PATCH] 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 --- db_stress_tool/db_stress_test_base.cc | 2 +- tools/ldb_tool.cc | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/db_stress_tool/db_stress_test_base.cc b/db_stress_tool/db_stress_test_base.cc index 844225651..481a7bfd7 100644 --- a/db_stress_tool/db_stress_test_base.cc +++ b/db_stress_tool/db_stress_test_base.cc @@ -464,7 +464,7 @@ Status StressTest::NewTxn(WriteOptions& write_opts, Transaction** txn) { } static std::atomic txn_id = {0}; TransactionOptions txn_options; - txn_options.lock_timeout = 60000; // 1min + txn_options.lock_timeout = 60000; // 1min txn_options.deadlock_detect = true; *txn = txn_db_->BeginTransaction(write_opts, txn_options); auto istr = std::to_string(txn_id.fetch_add(1)); diff --git a/tools/ldb_tool.cc b/tools/ldb_tool.cc index c4fa97cc6..ac90a40f9 100644 --- a/tools/ldb_tool.cc +++ b/tools/ldb_tool.cc @@ -107,7 +107,10 @@ int LDBCommandRunner::RunCommand( const LDBOptions& ldb_options, const std::vector* column_families) { 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, ROCKSDB_PATCH); return 0;