tisonkun commented on code in PR #1037:
URL:
https://github.com/apache/incubator-kvrocks/pull/1037#discussion_r1003265542
##########
src/main.cc:
##########
@@ -112,30 +109,47 @@ void setupSigSegvAction() {
sigaction(SIGINT, &act, nullptr);
}
-static void usage(const char *program) {
- std::cout << program << " implements the Redis protocol based on rocksdb\n"
- << "\t-c config file\n"
- << "\t-h help\n";
- exit(0);
+constexpr const char *description =
+ "a distributed key value NoSQL database that uses RocksDB as storage
engine and is compatible with Redis protocol";
+
+static void printUsage(const char *program) {
+ const int width = 32;
+
+ std::cout << program << description << std::endl
+ << std::left << std::setw(width) << "-c, --config <filename>"
+ << "set config file to <filename>, or `-' for stdin" << std::endl
+ << std::setw(width) << "-v, --version"
+ << "print version information" << std::endl
+ << std::setw(width) << "-h, --help"
+ << "print this help message" << std::endl
+ << std::setw(width) << "--<config-key> <config-value>"
+ << "overwrite specific config option <config-key> to
<config-value>" << std::endl;
}
Review Comment:
You may notice the format is malformed and whitespace isn't pretty inserted.
Also, I don't think that we should print a long description like "a
distributed key value NoSQL database that uses RocksDB as storage engine and is
compatible with Redis protocol".
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]