VTY: don't show HIDDEN or DEPRECATED vty commands in ? completion

This hides HIDDEN or DEPRECATED commands from showing up when the
full list of commands is inquired with '?' at any given point in the
command tree.  Only if the hidden/deprecated command is already typed
in partially, then it will still tab-complete.
This commit is contained in:
Harald Welte 2013-02-12 11:11:34 +01:00
parent 80d30fe803
commit d17aa59c3e
1 changed files with 3 additions and 0 deletions

View File

@ -1600,6 +1600,9 @@ cmd_describe_command_real(vector vline, struct vty *vty, int *status)
if (!cmd_element)
continue;
if (cmd_element->attr & (CMD_ATTR_DEPRECATED|CMD_ATTR_HIDDEN))
continue;
strvec = cmd_element->strvec;
/* if command is NULL, index may be equal to vector_active */