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
09df2607
Commit
09df2607
authored
Feb 25, 2017
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow and ignore a leading '-' on cli commands.
parent
20c5f379
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
1 deletion
+8
-1
b00008.vtc
bin/varnishtest/tests/b00008.vtc
+2
-0
vcli_serve.h
include/vcli_serve.h
+1
-0
vcli_serve.c
lib/libvarnish/vcli_serve.c
+5
-1
No files found.
bin/varnishtest/tests/b00008.vtc
View file @
09df2607
...
...
@@ -4,6 +4,8 @@ varnish v1 -arg "-b ${bad_ip}:9080"
varnish v1 -cliok "help"
varnish v1 -cliok "-help"
varnish v1 -cliok "help -a"
varnish v1 -cliok "help -d"
...
...
include/vcli_serve.h
View file @
09df2607
...
...
@@ -70,6 +70,7 @@ struct cli_proto {
struct
cli
{
unsigned
magic
;
#define CLI_MAGIC 0x4038d570
void
*
priv
;
struct
vsb
*
sb
;
enum
VCLI_status_e
result
;
char
*
cmd
;
...
...
lib/libvarnish/vcli_serve.c
View file @
09df2607
...
...
@@ -344,7 +344,10 @@ cls_vlu(void *priv, const char *p)
return
(
0
);
REPLACE
(
cli
->
cmd
,
p
);
av
=
VAV_Parse
(
p
,
NULL
,
0
);
if
(
p
[
0
]
==
'-'
)
av
=
VAV_Parse
(
p
+
1
,
NULL
,
0
);
else
av
=
VAV_Parse
(
p
,
NULL
,
0
);
AN
(
av
);
if
(
av
[
0
]
!=
NULL
)
{
i
=
cls_vlu2
(
priv
,
av
);
...
...
@@ -429,6 +432,7 @@ VCLS_AddFd(struct VCLS *cs, int fdi, int fdo, cls_cb_f *closefunc, void *priv)
cfd
->
cli
->
vlu
=
VLU_New
(
cfd
,
cls_vlu
,
*
cs
->
maxlen
);
cfd
->
cli
->
sb
=
VSB_new_auto
();
cfd
->
cli
->
limit
=
cs
->
limit
;
cfd
->
cli
->
priv
=
priv
;
cfd
->
closefunc
=
closefunc
;
cfd
->
priv
=
priv
;
AN
(
cfd
->
cli
->
sb
);
...
...
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