Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
varnishevent
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
uplex-varnish
varnishevent
Commits
6dafe04e
Commit
6dafe04e
authored
Apr 19, 2015
by
Geoff Simmons
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added -h option and a correct usage message
parent
81de90f2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
10 deletions
+14
-10
varnishevent.c
src/varnishevent.c
+14
-10
No files found.
src/varnishevent.c
View file @
6dafe04e
...
...
@@ -420,12 +420,14 @@ read_default_config(void) {
}
static
void
usage
(
void
)
usage
(
int
status
)
{
fprintf
(
stderr
,
"usage: varnishevent [-aDVg] [-G configfile] [-P pidfile] "
"[-w outputfile]
\n
"
);
exit
(
1
);
"usage: varnishevent [-adDhvV] [-f configfile] [-F format]
\n
"
" [-g grouping] [-L txlimit] [-n name]
\n
"
" [-N vsmfile] [-P pidfile] [-q query]
\n
"
" [-r binlog] [-T txtimeout] [-w outputfile]
\n
"
);
exit
(
status
);
}
int
...
...
@@ -446,7 +448,7 @@ main(int argc, char *argv[])
CONF_Init
();
read_default_config
();
while
((
c
=
getopt
(
argc
,
argv
,
"adDvVP:w:F:g:f:q:r:n:N:L:T:"
))
!=
-
1
)
{
while
((
c
=
getopt
(
argc
,
argv
,
"adD
h
vVP:w:F:g:f:q:r:n:N:L:T:"
))
!=
-
1
)
{
switch
(
c
)
{
case
'a'
:
a_flag
=
1
;
...
...
@@ -506,23 +508,25 @@ main(int argc, char *argv[])
case
'T'
:
if
((
errnum
=
VSL_Arg
(
vsl
,
c
,
optarg
))
<
0
)
{
fprintf
(
stderr
,
"%s
\n
"
,
VSL_Error
(
vsl
));
usage
();
usage
(
EXIT_FAILURE
);
}
/* XXX: VSL_Arg doesn't check this */
if
(
c
==
'L'
&&
atoi
(
optarg
)
==
0
)
{
fprintf
(
stderr
,
"-L: Range error
\n
"
);
usage
();
usage
(
EXIT_FAILURE
);
}
AN
(
errnum
);
break
;
case
'h'
:
usage
(
EXIT_SUCCESS
);
default:
usage
();
usage
(
EXIT_FAILURE
);
}
}
if
(
n_arg
&&
N_arg
)
{
fprintf
(
stderr
,
"Cannot have both -n and -N options
\n
"
);
usage
();
usage
(
EXIT_FAILURE
);
}
if
(
!
EMPTY
(
cli_config_filename
))
{
...
...
@@ -537,7 +541,7 @@ main(int argc, char *argv[])
if
(
!
EMPTY
(
config
.
varnish_bindump
)
&&
(
n_arg
||
N_arg
))
{
fprintf
(
stderr
,
"Cannot specify -r/varnish.bindump together with -n "
" or -N
\n
"
);
usage
();
usage
(
EXIT_FAILURE
);
}
if
(
P_arg
&&
(
pfh
=
VPF_Open
(
P_arg
,
0644
,
NULL
))
==
NULL
)
{
...
...
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