summaryrefslogtreecommitdiff
path: root/lib/command.c
diff options
context:
space:
mode:
authorpaul <paul>2005-03-08 15:56:42 +0000
committerpaul <paul>2005-03-08 15:56:42 +0000
commit9c5d8562f8d24574ba1f43881d47cbc8ffc62027 (patch)
tree816690e607e208aa66b257fb9ef01ae8bd80acb6 /lib/command.c
parentb45da6f01612e8ec1938cacfe0ea0ef34ad1afca (diff)
2005-03-08 Paul Jakma <paul.jakma@sun.com>
* command.c: (cmd_describe_command_real) sign compile warning fix (cmd_complete_command_real) ditto. (config_list_cmd) Don't list hidden or deprecated commands, hiding these from tab completion is still to be done. * command.h: cmd attr enum should start at 1.
Diffstat (limited to 'lib/command.c')
-rw-r--r--lib/command.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/lib/command.c b/lib/command.c
index 7656f680..d83ebe12 100644
--- a/lib/command.c
+++ b/lib/command.c
@@ -1,5 +1,5 @@
/*
- $Id: command.c,v 1.39 2005/03/08 15:16:57 paul Exp $
+ $Id: command.c,v 1.40 2005/03/08 15:56:42 paul Exp $
Command interpreter routine for virtual terminal [aka TeletYpe]
Copyright (C) 1997, 98, 99 Kunihiro Ishiguro
@@ -1561,12 +1561,12 @@ cmd_try_do_shortcut (enum node_type node, char* first_word) {
static vector
cmd_describe_command_real (vector vline, struct vty *vty, int *status)
{
- int i;
+ unsigned int i;
vector cmd_vector;
#define INIT_MATCHVEC_SIZE 10
vector matchvec;
struct cmd_element *cmd_element;
- int index;
+ unsigned int index;
int ret;
enum match_type match;
char *command;
@@ -1757,12 +1757,12 @@ cmd_lcd (char **matched)
static char **
cmd_complete_command_real (vector vline, struct vty *vty, int *status)
{
- int i;
+ unsigned int i;
vector cmd_vector = vector_copy (cmd_node_vector (cmdvec, vty->node));
#define INIT_MATCHVEC_SIZE 10
vector matchvec;
struct cmd_element *cmd_element;
- int index = vector_max (vline) - 1;
+ unsigned int index = vector_max (vline) - 1;
char **match_str;
struct desc *desc;
vector descvec;
@@ -2483,7 +2483,9 @@ DEFUN (config_list,
struct cmd_element *cmd;
for (i = 0; i < vector_max (cnode->cmd_vector); i++)
- if ((cmd = vector_slot (cnode->cmd_vector, i)) != NULL)
+ if ((cmd = vector_slot (cnode->cmd_vector, i)) != NULL
+ && !(cmd->attr == CMD_ATTR_DEPRECATED
+ || cmd->attr == CMD_ATTR_HIDDEN))
vty_out (vty, " %s%s", cmd->string,
VTY_NEWLINE);
return CMD_SUCCESS;