]> git.proxmox.com Git - mirror_kronosnet.git/commitdiff
vty_cli_cmds: add help command
authorFabio M. Di Nitto <fdinitto@redhat.com>
Mon, 1 Nov 2010 10:44:20 +0000 (11:44 +0100)
committerFabio M. Di Nitto <fdinitto@redhat.com>
Mon, 1 Nov 2010 10:44:20 +0000 (11:44 +0100)
Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
vty_cli_cmds.c

index 83f00e367be16827bc521a538e52059ecc7176d4..65d03efde9a2d01c84299a50acbd30dd68041e8c 100644 (file)
@@ -9,6 +9,7 @@
 /* forward declarations */
 
 static int knet_cmd_who(struct knet_vty *vty);
+static int knet_cmd_help(struct knet_vty *vty);
 
 enum vty_nodes {
        ROOT = 0,
@@ -16,8 +17,9 @@ enum vty_nodes {
 };
 
 vty_node_cmds_t root_cmds[] = {
-       { "who", "Show users connected", NULL, NULL, knet_cmd_who },
-       { "show", NULL, NULL, NULL, NULL },
+       { "who", "Display users connected to CLI", NULL, NULL, knet_cmd_who },
+       { "help", "Display basic help", NULL, NULL, knet_cmd_help },
+       { "show", "Show several information", NULL, NULL, NULL },
        { NULL, NULL, NULL, NULL, NULL },
 };
 
@@ -48,6 +50,12 @@ static int knet_cmd_who(struct knet_vty *vty)
        return 0;
 }
 
+static int knet_cmd_help(struct knet_vty *vty)
+{
+       knet_vty_help(vty);
+       return 0;
+}
+
 static char *get_first_word(struct knet_vty *vty)
 {
        int start = 0, idx;