Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
varnish-cache
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
varnishcache
varnish-cache
Commits
075e6e64
Commit
075e6e64
authored
Oct 10, 2013
by
Martin Blix Grydeland
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implement -V (version) for vut (varnishlog)
parent
b2a04a0a
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
20 additions
and
10 deletions
+20
-10
varnishlog.c
bin/varnishlog/varnishlog.c
+4
-2
varnishlog_options.h
bin/varnishlog/varnishlog_options.h
+1
-0
varnishlog.rst
doc/sphinx/reference/varnishlog.rst
+0
-6
vut.h
include/vut.h
+3
-1
vut_options.h
include/vut_options.h
+5
-0
vut.c
lib/libvarnishtools/vut.c
+7
-1
No files found.
bin/varnishlog/varnishlog.c
View file @
075e6e64
...
...
@@ -50,11 +50,13 @@
#include "vtim.h"
#include "vut.h"
static
const
char
progname
[]
=
"varnishlog"
;
static
void
usage
(
void
)
{
const
char
**
opt
;
fprintf
(
stderr
,
"Usage:
varnishlog <options>
\n\n
"
);
fprintf
(
stderr
,
"Usage:
%s <options>
\n\n
"
,
progname
);
fprintf
(
stderr
,
"Options:
\n
"
);
for
(
opt
=
vopt_usage
;
*
opt
!=
NULL
;
opt
+=
2
)
fprintf
(
stderr
,
" %-25s %s
\n
"
,
*
opt
,
*
(
opt
+
1
));
...
...
@@ -66,7 +68,7 @@ main(int argc, char * const *argv)
{
char
opt
;
VUT_Init
();
VUT_Init
(
progname
);
while
((
opt
=
getopt
(
argc
,
argv
,
vopt_optstring
))
!=
-
1
)
{
switch
(
opt
)
{
...
...
bin/varnishlog/varnishlog_options.h
View file @
075e6e64
...
...
@@ -48,6 +48,7 @@ VUT_OPT_r
VSL_OPT_T
VUT_OPT_u
VSL_OPT_v
VUT_OPT_V
VUT_OPT_w
VSL_OPT_x
VSL_OPT_X
doc/sphinx/reference/varnishlog.rst
View file @
075e6e64
...
...
@@ -43,12 +43,6 @@ The following options are available:
XXX: Not yet implemented
-V
Display the version number and exit.
XXX: Not yet implemented
SIGNALS
=======
...
...
include/vut.h
View file @
075e6e64
...
...
@@ -32,6 +32,8 @@
#include "vdef.h"
struct
VUT
{
const
char
*
progname
;
/* Options */
int
a_opt
;
int
d_opt
;
...
...
@@ -65,7 +67,7 @@ int VUT_Arg(int opt, const char *arg);
void
VUT_Setup
(
void
);
void
VUT_Init
(
void
);
void
VUT_Init
(
const
char
*
progname
);
void
VUT_Fini
(
void
);
...
...
include/vut_options.h
View file @
075e6e64
...
...
@@ -84,6 +84,11 @@
"Unbuffered binary file output mode." \
)
#define VUT_OPT_V \
VOPT("V", "[-V]", "Version", \
"Print version information and exit." \
)
#define VUT_OPT_w \
VOPT("w:", "[-w filename]", "Binary output filename", \
"Write log entries to this file instead of displaying" \
...
...
lib/libvarnishtools/vut.c
View file @
075e6e64
...
...
@@ -48,6 +48,7 @@
#include "vtim.h"
#include "vas.h"
#include "miniobj.h"
#include "vcs.h"
#include "vut.h"
...
...
@@ -164,6 +165,10 @@ VUT_Arg(int opt, const char *arg)
/* Unbuffered binary output */
VUT
.
u_opt
=
1
;
return
(
1
);
case
'V'
:
/* Print version number and exit */
VCS_Message
(
VUT
.
progname
);
exit
(
1
);
case
'w'
:
/* Binary file output */
REPLACE
(
VUT
.
w_arg
,
arg
);
...
...
@@ -178,8 +183,9 @@ VUT_Arg(int opt, const char *arg)
}
void
VUT_Init
(
void
)
VUT_Init
(
const
char
*
progname
)
{
VUT
.
progname
=
progname
;
VUT
.
g_arg
=
VSL_g_vxid
;
AZ
(
VUT
.
vsl
);
VUT
.
vsl
=
VSL_New
();
...
...
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