mirror of
https://github.com/fluencelabs/redis
synced 2025-03-19 09:00:51 +00:00
Solving issue #191 on Google Code: -v and --version should print the version of Redis
This commit is contained in:
parent
c77169b7e9
commit
42ab0172ab
10
redis.c
10
redis.c
@ -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
|
||||||
@ -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) {
|
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) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user