lib/command.c: rewrite command matching/parsing

Add support for keyword commands.

Includes new documentation for DEFUN() in lib/command.h, for preexisting
features as well as new keyword specification.

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
diff --git a/tests/test-commands.c b/tests/test-commands.c
index e2f40c6..18b3b50 100644
--- a/tests/test-commands.c
+++ b/tests/test-commands.c
@@ -233,8 +233,6 @@
             cmd->daemon = 0;
             cmd->func = test_callback;
           }
-  sort_node();
-
   test_load();
   vty_init_vtysh();
 }
@@ -340,8 +338,8 @@
           {
             for (j = 0; j < vector_active(descriptions); j++)
               {
-                struct desc *cmd = vector_slot(descriptions, j);
-                printf("  '%s' '%s'\n", cmd->cmd, cmd->str);
+                struct cmd_token *cmd = vector_slot(descriptions, j);
+                printf("  '%s' '%s'\n", cmd->cmd, cmd->desc);
               }
             vector_free(descriptions);
           }