From: Donald Sharp Date: Tue, 10 Oct 2017 16:29:54 +0000 (-0400) Subject: lib: Add some documentation about argv_find X-Git-Tag: frr-4.0-dev~219^2 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=b286ddb07a3317bc4b0cb664c947968062aa5ae1;p=matthieu%2Ffrr.git lib: Add some documentation about argv_find 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 --- diff --git a/lib/command.h b/lib/command.h index 8cccb62de3..e2d31decd4 100644 --- a/lib/command.h +++ b/lib/command.h @@ -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);