summaryrefslogtreecommitdiff
path: root/lib/command.c
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2016-12-16 15:12:34 -0500
committerGitHub <noreply@github.com>2016-12-16 15:12:34 -0500
commitbcfb39acd7539d303b4aa3cc11d9ef7464358543 (patch)
tree8c05902fe53039daae373f4dffe151fa7a9426e8 /lib/command.c
parentf4e454eb79a6d63f0fba83635047215ac6cf0e5f (diff)
parenta6cf5da4fd6253b5f92ff4bee84d9e02c2439326 (diff)
Merge pull request #5 from freerangerouting/dev/osr/fixes_plus_vty_keywords
Merge branch 'dev/osr/fixes_plus_vty_keywords'
Diffstat (limited to 'lib/command.c')
-rw-r--r--lib/command.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/command.c b/lib/command.c
index 8d5493ca56..a93f3a55e8 100644
--- a/lib/command.c
+++ b/lib/command.c
@@ -686,6 +686,19 @@ cmd_complete_command (vector vline, struct vty *vty, int *status)
}
vector_free (initial_comps);
+ // since we filtered results, we need to re-set status code
+ switch (vector_active (comps))
+ {
+ case 0:
+ *status = CMD_ERR_NO_MATCH;
+ break;
+ case 1:
+ *status = CMD_COMPLETE_FULL_MATCH;
+ break;
+ default:
+ *status = CMD_COMPLETE_LIST_MATCH;
+ }
+
// copy completions text into an array of char*
ret = XMALLOC (MTYPE_TMP, (vector_active (comps)+1) * sizeof (char *));
unsigned int i;