Commit 44efe66e authored by antirez's avatar antirez
Browse files

Merged gnrfan patches fixing issues 191, 193, 194

parents 7bf90179 723fb69b
...@@ -799,6 +799,8 @@ static struct redisCommand cmdTable[] = { ...@@ -799,6 +799,8 @@ static struct redisCommand cmdTable[] = {
{NULL,NULL,0,0,NULL,0,0,0} {NULL,NULL,0,0,NULL,0,0,0}
}; };
static void usage();
/*============================ Utility functions ============================ */ /*============================ Utility functions ============================ */
/* Glob-style pattern matching. */ /* Glob-style pattern matching. */
...@@ -9168,19 +9170,23 @@ static void version() { ...@@ -9168,19 +9170,23 @@ static void version() {
exit(0); exit(0);
} }
static void usage() {
fprintf(stderr,"Usage: ./redis-server [/path/to/redis.conf]\n");
exit(1);
}
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)) { if (strcmp(argv[1], "-v") == 0 ||
version(); strcmp(argv[1], "--version") == 0) version();
} if (strcmp(argv[1], "--help") == 0) usage();
resetServerSaveParams(); resetServerSaveParams();
loadServerConfig(argv[1]); loadServerConfig(argv[1]);
} else if (argc > 2) { } else if ((argc > 2)) {
fprintf(stderr,"Usage: ./redis-server [/path/to/redis.conf]\n"); usage();
exit(1);
} else { } else {
redisLog(REDIS_WARNING,"Warning: no config file specified, using the default config. In order to specify a config file use 'redis-server /path/to/redis.conf'"); redisLog(REDIS_WARNING,"Warning: no config file specified, using the default config. In order to specify a config file use 'redis-server /path/to/redis.conf'");
} }
......
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