Commit 66db3c5e authored by Dridi Boukelmoune's avatar Dridi Boukelmoune

cli: Always mention VCL names in vcl.discard errors

This is going to be useful once vcl.discard can take multiple VCL names
at once.
parent 1c7294c9
......@@ -128,7 +128,7 @@ mcf_find_vcl(struct cli *cli, const char *name)
vp = mcf_vcl_byname(name);
if (vp == NULL) {
VCLI_SetResult(cli, CLIS_PARAM);
VCLI_Out(cli, "No VCL named %s known.", name);
VCLI_Out(cli, "No VCL named %s known\n", name);
}
return (vp);
}
......@@ -694,7 +694,8 @@ mgt_vcl_can_discard(struct cli *cli, const char * const *av)
return (NULL);
if (vp == active_vcl) {
VCLI_SetResult(cli, CLIS_CANT);
VCLI_Out(cli, "Cannot discard active VCL program\n");
VCLI_Out(cli, "Cannot discard active VCL program %s\n",
vp->name);
return (NULL);
}
if (VTAILQ_EMPTY(&vp->dto))
......@@ -703,11 +704,12 @@ mgt_vcl_can_discard(struct cli *cli, const char * const *av)
VCLI_SetResult(cli, CLIS_CANT);
AN(vp->warm);
if (!mcf_is_label(vp))
VCLI_Out(cli, "Cannot discard labeled VCL program.\n");
VCLI_Out(cli, "Cannot discard labeled VCL program %s:\n",
vp->name);
else
VCLI_Out(cli,
"Cannot discard this VCL label, "
"other VCLs depend on it.\n");
"Cannot discard VCL label %s, other VCLs depend on it:\n",
vp->name);
n = 0;
VTAILQ_FOREACH(vd, &vp->dto, lto) {
if (n++ == 5) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment