]> git.puffer.fish Git - mirror/frr.git/commitdiff
lib: guard strict cli completions 96/head
authorQuentin Young <qlyoung@cumulusnetworks.com>
Thu, 19 Jan 2017 17:07:39 +0000 (17:07 +0000)
committerQuentin Young <qlyoung@cumulusnetworks.com>
Thu, 19 Jan 2017 17:15:45 +0000 (17:15 +0000)
Completions are checked for token and docstring equality before
deduplicating. Put an ifdef guard around checking docstrings because
many of them are inconsistent and may confuse users in a release build.

It is a good idea to enable VTYSH_DEBUG when adding new CLI in the
future to help check docstrings.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
lib/command.c

index 6294e994e70c7ca451cbc3d13ab45e9c4b9204fc..b5dae5f28e13bec5216cfaf0d193da1cad60c82c 100644 (file)
@@ -541,8 +541,12 @@ completions_to_vec (struct list *completions)
     for (i = 0; i < vector_active (comps) && !exists; i++)
     {
       struct cmd_token *curr = vector_slot (comps, i);
+#ifdef VTYSH_DEBUG
       exists = !strcmp (curr->text, token->text) &&
                !strcmp (curr->desc, token->desc);
+#else
+      exists = !strcmp (curr->text, token->text);
+#endif /* VTYSH_DEBUG */
     }
 
     if (!exists)