projects
/
m6w6
/
libmemcached
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
|
github
raw
|
patch
| inline |
side by side
(parent:
17593c4
)
implement --flags for memcat, display flags instead of content
author
Mark Atwood
<mark@fallenpegasus.com>
Wed, 19 Sep 2007 10:15:23 +0000
(
03:15
-0700)
committer
Mark Atwood
<mark@fallenpegasus.com>
Wed, 19 Sep 2007 10:15:23 +0000
(
03:15
-0700)
src/memcat.c
patch
|
blob
|
history
diff --git
a/src/memcat.c
b/src/memcat.c
index ff8319bec8428ad67933b1274e47416245aa37eb..645b54ac3d762f7459823e835f6d5b1fda16e47c 100644
(file)
--- a/
src/memcat.c
+++ b/
src/memcat.c
@@
-78,10
+78,16
@@
int main(int argc, char *argv[])
{
\r
string= memcached_get(memc, argv[x], strlen(argv[x]),
\r
&string_length, &flags, &rc);
\r
- if (string)
\r
- {
\r
- printf("%.*s\n", string_length, string);
\r
- free(string);
\r
+ if (rc == MEMCACHED_SUCCESS) {
\r
+ if (opt_displayflag) {
\r
+ printf("%d\n", flags);
\r
+ } else {
\r
+ if (string)
\r
+ {
\r
+ printf("%.*s\n", string_length, string);
\r
+ free(string);
\r
+ }
\r
+ }
\r
}
\r
}
\r
\r