提交 5e2022bb 编写于 作者: A antirez

Merge branch 'issue_191' of git://github.com/gnrfan/redis

...@@ -1102,6 +1102,8 @@ static dictType keylistDictType = { ...@@ -1102,6 +1102,8 @@ static dictType keylistDictType = {
dictListDestructor /* val destructor */ dictListDestructor /* val destructor */
}; };
static void version();
/* ========================= Random utility functions ======================= */ /* ========================= Random utility functions ======================= */
/* Redis generally does not try to recover from out of memory conditions /* Redis generally does not try to recover from out of memory conditions
...@@ -9158,11 +9160,19 @@ static void daemonize(void) { ...@@ -9158,11 +9160,19 @@ static void daemonize(void) {
} }
} }
static void version() {
printf("Redis server version %s\n", REDIS_VERSION);
exit(0);
}
int main(int argc, char **argv) { int main(int argc, char **argv) {
time_t start; time_t start;
initServerConfig(); initServerConfig();
if (argc == 2) { if (argc == 2) {
if ((strcmp(argv[1], "-v") == 0) || (strcmp(argv[1], "--version") == 0)) {
version();
}
resetServerSaveParams(); resetServerSaveParams();
loadServerConfig(argv[1]); loadServerConfig(argv[1]);
} else if (argc > 2) { } else if (argc > 2) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册