From 4b52c1a3590b43ca892c460d9b1478e1da742156 Mon Sep 17 00:00:00 2001 From: root Date: Tue, 27 Apr 2021 14:10:03 +0300 Subject: Add 'show version' command in CLI --- accel-pppd/cli/std_cmd.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'accel-pppd') diff --git a/accel-pppd/cli/std_cmd.c b/accel-pppd/cli/std_cmd.c index e752918..e22ea76 100644 --- a/accel-pppd/cli/std_cmd.c +++ b/accel-pppd/cli/std_cmd.c @@ -84,6 +84,17 @@ static void show_stat_help(char * const *fields, int fields_cnt, void *client) } //============================= +static int show_version_exec(const char *cmd, char * const *fields, int fields_cnt, void *client) +{ + cli_sendv(client, "%s\r\n", ACCEL_PPP_VERSION); +} + +static void show_version_help(char * const *fields, int fields_cnt, void *client) +{ + cli_send(client, "show version - shows version of running accel-pppd\r\n"); +} +//============================= + static int exit_exec(const char *cmd, char * const *fields, int fields_cnt, void *client) { return CLI_CMD_EXIT; @@ -381,6 +392,7 @@ static void restart_help(char * const *fields, int fields_cnt, void *client) static void init(void) { cli_register_simple_cmd2(show_stat_exec, show_stat_help, 2, "show", "stat"); + cli_register_simple_cmd2(show_version_exec, show_version_help, 2, "show", "version"); cli_register_simple_cmd2(terminate_exec, terminate_help, 1, "terminate"); cli_register_simple_cmd2(reload_exec, reload_help, 1, "reload"); cli_register_simple_cmd2(restart_exec, restart_help, 1, "restart"); -- cgit v1.2.3