Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
185cabda
Commit
185cabda
authored
Jul 06, 2010
by
antirez
Browse files
redis-cli is now able to report version information using -v
parent
443d1e9e
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/redis-cli.c
View file @
185cabda
...
@@ -29,6 +29,7 @@
...
@@ -29,6 +29,7 @@
*/
*/
#include "fmacros.h"
#include "fmacros.h"
#include "version.h"
#include <stdio.h>
#include <stdio.h>
#include <string.h>
#include <string.h>
...
@@ -315,6 +316,9 @@ static int parseOptions(int argc, char **argv) {
...
@@ -315,6 +316,9 @@ static int parseOptions(int argc, char **argv) {
config
.
interactive
=
1
;
config
.
interactive
=
1
;
}
else
if
(
!
strcmp
(
argv
[
i
],
"-c"
))
{
}
else
if
(
!
strcmp
(
argv
[
i
],
"-c"
))
{
config
.
argn_from_stdin
=
1
;
config
.
argn_from_stdin
=
1
;
}
else
if
(
!
strcmp
(
argv
[
i
],
"-v"
))
{
printf
(
"redis-cli shipped with Redis verison %s
\n
"
,
REDIS_VERSION
);
exit
(
0
);
}
else
{
}
else
{
break
;
break
;
}
}
...
@@ -340,7 +344,7 @@ static sds readArgFromStdin(void) {
...
@@ -340,7 +344,7 @@ static sds readArgFromStdin(void) {
}
}
static
void
usage
()
{
static
void
usage
()
{
fprintf
(
stderr
,
"usage: redis-cli [-h host] [-p port] [-a authpw] [-r repeat_times] [-n db_num]
[-i]
cmd arg1 arg2 arg3 ... argN
\n
"
);
fprintf
(
stderr
,
"usage: redis-cli
[-iv]
[-h host] [-p port] [-a authpw] [-r repeat_times] [-n db_num] cmd arg1 arg2 arg3 ... argN
\n
"
);
fprintf
(
stderr
,
"usage: echo
\"
argN
\"
| redis-cli -c [-h host] [-p port] [-a authpw] [-r repeat_times] [-n db_num] cmd arg1 arg2 ... arg(N-1)
\n
"
);
fprintf
(
stderr
,
"usage: echo
\"
argN
\"
| redis-cli -c [-h host] [-p port] [-a authpw] [-r repeat_times] [-n db_num] cmd arg1 arg2 ... arg(N-1)
\n
"
);
fprintf
(
stderr
,
"
\n
If a pipe from standard input is detected this data is used as last argument.
\n\n
"
);
fprintf
(
stderr
,
"
\n
If a pipe from standard input is detected this data is used as last argument.
\n\n
"
);
fprintf
(
stderr
,
"example: cat /etc/passwd | redis-cli set my_passwd
\n
"
);
fprintf
(
stderr
,
"example: cat /etc/passwd | redis-cli set my_passwd
\n
"
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment