Commit b8a4bb64 authored by Federico G. Schwindt's avatar Federico G. Schwindt Committed by Lasse Karstensen

Fix vcl.show -v handling with no VCL

While here display the right VCL name if -v is used and the VCL is
not found.
parent 52093641
...@@ -381,18 +381,23 @@ ccf_config_show(struct cli *cli, const char * const *av, void *priv) ...@@ -381,18 +381,23 @@ ccf_config_show(struct cli *cli, const char * const *av, void *priv)
int i; int i;
(void)priv; (void)priv;
if (!strcmp(av[2], "-v")) { if (!strcmp(av[2], "-v") && av[3] == NULL) {
verbose = 1; VCLI_Out(cli, "Too few parameters");
vcl = vcl_find(av[3]); VCLI_SetResult(cli, CLIS_TOOFEW);
} else if (av[3] != NULL) { return;
} else if (strcmp(av[2], "-v") && av[3] != NULL) {
VCLI_Out(cli, "Unknown options '%s'", av[2]); VCLI_Out(cli, "Unknown options '%s'", av[2]);
VCLI_SetResult(cli, CLIS_PARAM); VCLI_SetResult(cli, CLIS_PARAM);
return; return;
} else if (av[3] != NULL) {
verbose = 1;
vcl = vcl_find(av[3]);
} else } else
vcl = vcl_find(av[2]); vcl = vcl_find(av[2]);
if (vcl == NULL) { if (vcl == NULL) {
VCLI_Out(cli, "No VCL named '%s'", av[2]); VCLI_Out(cli, "No VCL named '%s'",
av[3] == NULL ? av[2] : av[3]);
VCLI_SetResult(cli, CLIS_PARAM); VCLI_SetResult(cli, CLIS_PARAM);
return; return;
} }
......
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