diff options
author | paul <paul> | 2005-03-08 15:56:42 +0000 |
---|---|---|
committer | paul <paul> | 2005-03-08 15:56:42 +0000 |
commit | 7c1363d6a775ae1d6c9101576d26b1a37b89a1f9 (patch) | |
tree | 571a120784b81165b4ec86e09d17d26187a39052 | |
parent | 317d0d43ba47a71441696aff76d03828f3ecf033 (diff) | |
download | quagga-7c1363d6a775ae1d6c9101576d26b1a37b89a1f9.tar.bz2 quagga-7c1363d6a775ae1d6c9101576d26b1a37b89a1f9.tar.xz |
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.
-rw-r--r-- | lib/ChangeLog | 7 | ||||
-rw-r--r-- | lib/command.c | 12 | ||||
-rw-r--r-- | lib/command.h | 2 |
3 files changed, 14 insertions, 7 deletions
diff --git a/lib/ChangeLog b/lib/ChangeLog index ca5d4c3c..03ca581f 100644 --- a/lib/ChangeLog +++ b/lib/ChangeLog @@ -1,6 +1,11 @@ 2005-03-08 Paul Jakma <paul.jakma@sun.com> - * command.c: (banner_motd_file_cmd) use XSTRDUP/XFREE + * command.c: (banner_motd_file_cmd) use XSTRDUP/XFREE. + (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. * vty.c: (vty_hello) suggestions from Andrew, read by line and stub out trailling non-printable characters on each line thus allowing us to specify VTY_NEWLINE to vty_out. diff --git a/lib/command.c b/lib/command.c index b035d272..15c06655 100644 --- a/lib/command.c +++ b/lib/command.c @@ -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; diff --git a/lib/command.h b/lib/command.h index 14808330..6fd42fa1 100644 --- a/lib/command.h +++ b/lib/command.h @@ -122,7 +122,7 @@ struct cmd_node enum { - CMD_ATTR_DEPRECATED, + CMD_ATTR_DEPRECATED = 1, CMD_ATTR_HIDDEN, }; |