Commit 10c48e5e authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Add two new CLI commands: param.set and param.show.

Eliminate requirement that "help" be first, I was just lazy I guess.


git-svn-id: http://www.varnish-cache.org/svn/trunk/varnish-cache@837 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent 2064427c
......@@ -31,6 +31,7 @@ varnishd_SOURCES = \
mgt_child.c \
mgt_cli.c \
mgt_event.c \
mgt_param.c \
mgt_vcc.c \
rfc2616.c \
shmlog.c \
......
......@@ -104,8 +104,8 @@ mcf_passthru(struct cli *cli, char **av, void *priv)
static struct cli_proto *cli_proto;
/* XXX: what order should this list be in ? */
static struct cli_proto mgt_cli_proto[] = {
{ CLI_HELP, cli_func_help, NULL }, /* must be first */
{ CLI_PING, cli_func_ping },
{ CLI_SERVER_START, mcf_server_startstop, NULL },
{ CLI_SERVER_STOP, mcf_server_startstop, &cli_proto },
......@@ -115,6 +115,9 @@ static struct cli_proto mgt_cli_proto[] = {
{ CLI_CONFIG_USE, mcf_config_use, NULL },
{ CLI_CONFIG_DISCARD, mcf_config_discard, NULL },
{ CLI_CONFIG_LIST, mcf_config_list, NULL },
{ CLI_PARAM_SHOW, mcf_param_show, NULL },
{ CLI_PARAM_SET, mcf_param_set, NULL },
{ CLI_HELP, cli_func_help, NULL },
#if 0
{ CLI_SERVER_RESTART },
{ CLI_ZERO },
......@@ -163,8 +166,12 @@ mgt_cli_init(void)
}
/* Fixup the entry for 'help' entry */
assert(!strcmp(cli_proto[0].request, "help"));
cli_proto[0].priv = cli_proto;
for (u = 0; cli_proto[u].request != NULL; u++) {
if (!strcmp(cli_proto[u].request, "help")) {
cli_proto[u].priv = cli_proto;
break;
}
}
}
/*--------------------------------------------------------------------
......
......@@ -5,6 +5,10 @@
/* mgt_child.c */
cli_func_t mcf_server_startstop;
/* mgt_param.c */
cli_func_t mcf_param_show;
cli_func_t mcf_param_set;
/* mgt_vcc.c */
cli_func_t mcf_config_load;
cli_func_t mcf_config_inline;
......
/*
* $Id$
*/
#include <unistd.h>
#include "cli_priv.h"
#include "mgt.h"
#include "mgt_cli.h"
void
mcf_param_show(struct cli *cli, char **av, void *priv)
{
(void)cli;
(void)av;
(void)priv;
}
void
mcf_param_set(struct cli *cli, char **av, void *priv)
{
(void)cli;
(void)av;
(void)priv;
}
......@@ -77,6 +77,18 @@
"\tSwitch to the named configuration immediately.", \
1, 1
#define CLI_PARAM_SHOW \
"param.show", \
"param.show [<param>]", \
"\tShow parameters and their values.", \
0, 1
#define CLI_PARAM_SET \
"param.set", \
"param.set <param> <value>", \
"\tSet parameter value.", \
2,2
#define CLI_SERVER_FREEZE \
"server.freeze", \
"server.freeze", \
......
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