Commit 8deb8953 authored by Dag Erling Smørgrav's avatar Dag Erling Smørgrav

Rename -1 to -f, and add a -1 option meaning "once". It currently does not

work very well; it should use a non-curses method to display the ranking.

git-svn-id: http://www.varnish-cache.org/svn/trunk/varnish-cache@1026 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent 51573e0d
......@@ -86,12 +86,12 @@ main(int argc, char **argv)
struct VSL_data *vd;
unsigned u, v;
struct top *tp, *tp2;
unsigned one_flag = 0;
int f_flag = 0;
vd = VSL_New();
while ((c = getopt(argc, argv, VSL_ARGS "1V")) != -1) {
while ((c = getopt(argc, argv, VSL_ARGS "1fV")) != -1) {
i = VSL_Arg(vd, c, optarg);
if (i < 0)
exit (1);
......@@ -99,7 +99,10 @@ main(int argc, char **argv)
continue;
switch (c) {
case '1':
one_flag = 1;
VSL_NonBlocking(vd, 1);
break;
case 'f':
f_flag = 1;
break;
case 'V':
varnish_version("varnishtop");
......@@ -130,7 +133,7 @@ main(int argc, char **argv)
u = 0;
q = p + 4;
for (i = 0; i < p[1]; i++, q++) {
if (one_flag && (*q == ':' || isspace(*q)))
if (f_flag && (*q == ':' || isspace(*q)))
break;
u += *q;
}
......
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