- fprintf(stderr, "usage: redis-cli [-iv] [-h host] [-p port] [-s /path/to/socket] [-a authpw] [-r repeat_times] [-n db_num] cmd arg1 arg2 arg3 ... argN\n");
- fprintf(stderr, "usage: echo \"argN\" | redis-cli -x [options] cmd arg1 arg2 ... arg(N-1)\n\n");
- fprintf(stderr, "example: cat /etc/passwd | redis-cli -x set my_passwd\n");
- fprintf(stderr, "example: redis-cli get my_passwd\n");
- fprintf(stderr, "example: redis-cli -r 100 lpush mylist x\n");
- fprintf(stderr, "\nRun in interactive mode: redis-cli -i or just don't pass any command\n");
+ sds version = cliVersion();
+ fprintf(stderr,
+"redis-cli %s\n"
+"\n"
+"Usage: redis-cli [OPTIONS] [cmd [arg [arg ...]]]\n"
+" -h <hostname> Server hostname (default: 127.0.0.1)\n"
+" -p <port> Server port (default: 6379)\n"
+" -s <socket> Server socket (overrides hostname and port)\n"
+" -a <password> Password to use when connecting to the server\n"
+" -r <repeat> Execute specified command N times\n"
+" -i <interval> When -r is used, waits <interval> seconds per command.\n"
+" It is possible to specify sub-second times like -i 0.1.\n"
+" -n <db> Database number\n"
+" -x Read last argument from STDIN\n"
+" -d <delimiter> Multi-bulk delimiter in for raw formatting (default: \\n)\n"
+" --raw Use raw formatting for replies (default when STDOUT is not a tty)\n"
+" --help Output this help and exit\n"
+" --version Output version and exit\n"
+"\n"
+"Examples:\n"
+" cat /etc/passwd | redis-cli -x set mypasswd\n"
+" redis-cli get mypasswd\n"
+" redis-cli -r 100 lpush mylist x\n"
+" redis-cli -r 100 -i 1 info | grep used_memory_human:\n"
+"\n"
+"When no command is given, redis-cli starts in interactive mode.\n"
+"Type \"help\" in interactive mode for information on available commands.\n"
+"\n",
+ version);
+ sdsfree(version);