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
e01a49e1
Commit
e01a49e1
authored
Jun 04, 2016
by
Federico G. Schwindt
Committed by
Lasse Karstensen
Jun 14, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add -h and use different exit status
parent
2bb8e5a6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
8 deletions
+14
-8
varnishadm.c
bin/varnishadm/varnishadm.c
+10
-7
varnishadm.rst
doc/sphinx/reference/varnishadm.rst
+4
-1
No files found.
bin/varnishadm/varnishadm.c
View file @
e01a49e1
...
...
@@ -378,13 +378,13 @@ pass(int sock)
static
void
usage
(
void
)
usage
(
int
status
)
{
fprintf
(
stderr
,
"Usage: varnishadm [-n ident] [-t timeout] [-S secretfile] "
"Usage: varnishadm [-
h] [-
n ident] [-t timeout] [-S secretfile] "
"[-T [address]:port] [command [...]]
\n
"
);
fprintf
(
stderr
,
"
\t
-n is mutually exclusive with -S and -T
\n
"
);
exit
(
1
);
exit
(
status
);
}
static
int
...
...
@@ -456,8 +456,11 @@ main(int argc, char * const *argv)
* The '+' stops that from happening
* See #1496
*/
while
((
opt
=
getopt
(
argc
,
argv
,
"+n:S:T:t:"
))
!=
-
1
)
{
while
((
opt
=
getopt
(
argc
,
argv
,
"+
h
n:S:T:t:"
))
!=
-
1
)
{
switch
(
opt
)
{
case
'h'
:
/* Usage help */
usage
(
0
);
case
'n'
:
n_arg
=
optarg
;
break
;
...
...
@@ -470,10 +473,10 @@ main(int argc, char * const *argv)
case
't'
:
timeout
=
VNUM
(
optarg
);
if
(
isnan
(
timeout
))
usage
();
usage
(
1
);
break
;
default:
usage
();
usage
(
1
);
}
}
...
...
@@ -482,7 +485,7 @@ main(int argc, char * const *argv)
if
(
n_arg
!=
NULL
)
{
if
(
T_arg
!=
NULL
||
S_arg
!=
NULL
)
{
usage
();
usage
(
1
);
}
sock
=
n_arg_sock
(
n_arg
);
}
else
if
(
T_arg
==
NULL
)
{
...
...
doc/sphinx/reference/varnishadm.rst
View file @
e01a49e1
...
...
@@ -14,7 +14,7 @@ Control a running Varnish instance
SYNOPSIS
========
varnishadm [-n ident] [-t timeout] [-S secretfile] [-T [address]:port] [command [...]]
varnishadm [-
h] [-
n ident] [-t timeout] [-S secretfile] [-T [address]:port] [command [...]]
DESCRIPTION
...
...
@@ -35,6 +35,9 @@ replies between the CLI socket and stdin/stdout.
OPTIONS
=======
-h
Print program usage and exit.
-n ident
Connect to the instance of `varnishd` with this name.
...
...
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