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
e7ad1e46
Commit
e7ad1e46
authored
Feb 15, 2021
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Give `varnishadm` a `-p` to disable libreadline and get VCLI compliance.
parent
e98e8e64
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
5 deletions
+19
-5
varnishadm.c
bin/varnishadm/varnishadm.c
+10
-3
u00012.vtc
bin/varnishtest/tests/u00012.vtc
+4
-2
varnishadm.rst
doc/sphinx/reference/varnishadm.rst
+5
-0
No files found.
bin/varnishadm/varnishadm.c
View file @
e7ad1e46
...
...
@@ -75,6 +75,7 @@
static
const
double
timeout
=
5
;
// XXX should be settable by arg ?
static
int
p_arg
=
0
;
static
void
cli_write
(
int
sock
,
const
char
*
s
)
...
...
@@ -254,6 +255,9 @@ pass_answer(int fd)
RL_EXIT
(
1
);
}
if
(
p_arg
)
printf
(
"%-3u %-8zu
\n
"
,
status
,
strlen
(
answer
));
else
printf
(
"%u
\n
"
,
status
);
if
(
answer
)
{
printf
(
"%s
\n
"
,
answer
);
...
...
@@ -441,7 +445,7 @@ main(int argc, char * const *argv)
* The '+' stops that from happening
* See #1496
*/
while
((
opt
=
getopt
(
argc
,
argv
,
"+hn:S:T:t:"
))
!=
-
1
)
{
while
((
opt
=
getopt
(
argc
,
argv
,
"+hn:
p
S:T:t:"
))
!=
-
1
)
{
switch
(
opt
)
{
case
'h'
:
/* Usage help */
...
...
@@ -449,6 +453,9 @@ main(int argc, char * const *argv)
case
'n'
:
n_arg
=
optarg
;
break
;
case
'p'
:
p_arg
=
1
;
break
;
case
'S'
:
S_arg
=
optarg
;
break
;
...
...
@@ -485,7 +492,7 @@ main(int argc, char * const *argv)
NEEDLESS
(
exit
(
0
));
}
if
(
isatty
(
0
))
if
(
isatty
(
0
)
&&
!
p_arg
)
interactive
(
sock
);
else
pass
(
sock
);
...
...
bin/varnishtest/tests/u00012.vtc
View file @
e7ad1e46
...
...
@@ -14,10 +14,12 @@ client c1 {
varnish v1 -vsl_catchup
process p1 -log {cat | varnishadm -n ${v1_name}} -start
process p1 -log {cat | varnishadm -
p -
n ${v1_name}} -start
process p1 -write "ping\r"
process p1 -expect-text 0 1 "200 19"
process p1 -expect-text 0 1 "PONG"
process p1 -write "vcl.list\r"
...
...
doc/sphinx/reference/varnishadm.rst
View file @
e7ad1e46
...
...
@@ -38,6 +38,11 @@ OPTIONS
-h
Print program usage and exit.
-p
Force `pass` mode and make the output follow the VCLI protocol.
This disables command-history/command-completion and makes it
easier for programs to parse the response(s).
-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