summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2013-02-12 11:11:34 +0100
committerHarald Welte <laforge@gnumonks.org>2013-02-12 11:11:34 +0100
commitd17aa59c3e7646667f70601eb7fc4ff11ada7604 (patch)
tree5482979cda97cde01bc11e2d0b03126f3d189383
parent80d30fe8036b4e79e16e766846a173e822d95512 (diff)
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.
-rw-r--r--src/vty/command.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/vty/command.c b/src/vty/command.c
index ac731ee0..4f47a6be 100644
--- a/src/vty/command.c
+++ b/src/vty/command.c
@@ -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 */