Commit 42ab0172 authored by Antonio Ognio's avatar Antonio Ognio
Browse files

Solving issue #191 on Google Code: -v and --version should print the version of Redis

parent c77169b7
......@@ -1102,6 +1102,8 @@ static dictType keylistDictType = {
dictListDestructor /* val destructor */
};
static void version();
/* ========================= Random utility functions ======================= */
/* Redis generally does not try to recover from out of memory conditions
......@@ -9122,11 +9124,19 @@ static void daemonize(void) {
}
}
static void version() {
printf("Redis server version %s\n", REDIS_VERSION);
exit(0);
}
int main(int argc, char **argv) {
time_t start;
initServerConfig();
if (argc == 2) {
if ((strcmp(argv[1], "-v") == 0) || (strcmp(argv[1], "--version") == 0)) {
version();
}
resetServerSaveParams();
loadServerConfig(argv[1]);
} else if (argc > 2) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment