Commit e8f8afc5 authored by Dridi Boukelmoune's avatar Dridi Boukelmoune

cli: Teach param.reset -j to output param.show

parent aa2fc004
......@@ -713,7 +713,7 @@ mcf_wash_param(struct cli *cli, struct parspec *pp, enum mcf_which_e which,
static struct cli_proto cli_params[] = {
{ CLICMD_PARAM_SHOW, "", mcf_param_show, mcf_param_show_json },
{ CLICMD_PARAM_SET, "", mcf_param_set, mcf_param_set_json },
{ CLICMD_PARAM_RESET, "", mcf_param_reset },
{ CLICMD_PARAM_RESET, "", mcf_param_reset, mcf_param_set_json },
{ NULL }
};
......
......@@ -10,6 +10,7 @@ varnish v1 -cliok "param.show vsl_mask"
varnish v1 -cliexpect {"value": "none"} "param.set -j feature none"
varnish v1 -cliexpect {"value": "all"} "param.set -j vsl_mask all"
varnish v1 -cliexpect {"value": "all(,-\w+)+"} "param.reset -j vsl_mask"
varnish v1 -clierr 106 "param.set vsl_mask FooBar"
varnish v1 -clierr 106 "param.set vsl_mask -FooBar"
......
......@@ -172,9 +172,11 @@ CLI_CMD(VCL_LABEL,
CLI_CMD(PARAM_RESET,
"param.reset",
"param.reset <param>",
"param.reset [-j] <param>",
"Reset parameter to default value.",
"",
" The JSON output is the same as ``param.show -j <param>`` and"
" contains the updated value as it would be represented by a"
" subsequent execution of ``param.show``.\n\n",
1,1
)
......
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