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
fa0f8b40
Commit
fa0f8b40
authored
Oct 10, 2013
by
Martin Blix Grydeland
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add -h option to print usage and exit
parent
075e6e64
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
4 deletions
+12
-4
varnishlog.c
bin/varnishlog/varnishlog.c
+6
-4
varnishlog_options.h
bin/varnishlog/varnishlog_options.h
+1
-0
vut_options.h
include/vut_options.h
+5
-0
No files found.
bin/varnishlog/varnishlog.c
View file @
fa0f8b40
...
...
@@ -53,14 +53,14 @@
static
const
char
progname
[]
=
"varnishlog"
;
static
void
usage
(
void
)
usage
(
int
status
)
{
const
char
**
opt
;
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
));
exit
(
1
);
exit
(
status
);
}
int
...
...
@@ -72,14 +72,16 @@ main(int argc, char * const *argv)
while
((
opt
=
getopt
(
argc
,
argv
,
vopt_optstring
))
!=
-
1
)
{
switch
(
opt
)
{
case
'h'
:
usage
(
0
);
default:
if
(
!
VUT_Arg
(
opt
,
optarg
))
usage
();
usage
(
1
);
}
}
if
(
optind
!=
argc
)
usage
();
usage
(
1
);
VUT_Setup
();
VUT_Main
(
NULL
,
NULL
);
...
...
bin/varnishlog/varnishlog_options.h
View file @
fa0f8b40
...
...
@@ -37,6 +37,7 @@ VSL_OPT_C
VUT_OPT_d
VUT_OPT_D
VUT_OPT_g
VUT_OPT_h
VSL_OPT_i
VSL_OPT_I
VSL_OPT_L
...
...
include/vut_options.h
View file @
fa0f8b40
...
...
@@ -52,6 +52,11 @@
" by request." \
)
#define VUT_OPT_h \
VOPT("h", "[-h]", "Usage help", \
"Print program usage and exit" \
)
#define VUT_OPT_n \
VOPT("n:", "[-n name]", "Varnish instance name", \
"Specify the name of the varnishd instance to get logs" \
...
...
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