]> git.puffer.fish Git - matthieu/frr.git/commitdiff
lib: Add some documentation about argv_find
authorDonald Sharp <sharpd@cumulusnetworks.com>
Tue, 10 Oct 2017 16:29:54 +0000 (12:29 -0400)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Tue, 10 Oct 2017 16:31:36 +0000 (12:31 -0400)
We expect that the index value passed in for argv_find
should be initially set to 0.  This way if the cli
ever changes there is no need to modify the initial
value.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
lib/command.h

index 8cccb62de33c59fa9a11bbec8fca10882ed570b1..e2d31decd44f5e5bd213e5167b645e5ed07f0342 100644 (file)
@@ -380,6 +380,13 @@ extern void uninstall_element(enum node_type, struct cmd_element *);
    string with a space between each element (allocated using
    XMALLOC(MTYPE_TMP)).  Returns NULL if shift >= argc. */
 extern char *argv_concat(struct cmd_token **argv, int argc, int shift);
+
+/*
+ * It is preferred that you set the index initial value
+ * to a 0.  This way in the future if you modify the
+ * cli then there is no need to modify the initial
+ * value of the index
+ */
 extern int argv_find(struct cmd_token **argv, int argc, const char *text,
                     int *index);