cmdline: add the incomplete token string as an argument of iter_start()
[libcmdline.git] / src / lib / cmdline_parse.h
index 5112ab5..6facb9e 100644 (file)
@@ -91,12 +91,13 @@ typedef struct cmdline_token_hdr cmdline_parse_token_hdr_t;
  * error.
  *
  * complete_start() prepares a completion operation. The first
- * argument is the token to complete. The second argument is an opaque
- * pointer that will be given to complete_iterate() function. It can
- * be used to store private data for this completion. For each
- * complete_start() call, the user must call complete_end() at the end
- * of iterations (if defined). Return a negative value if completion
- * is not possible, or 0 on success.
+ * argument is the token to complete. The second argument is the token
+ * to complete, and the third arg is an opaque pointer that will be
+ * given to complete_iterate() function. It can be used to store
+ * private data for this completion. For each complete_start() call,
+ * the user must call complete_end() at the end of iterations (if
+ * defined). Return a negative value if completion is not possible, or
+ * 0 on success.
  *
  * complete_iterate() copy in dstbuf (the size is specified in the
  * parameter) the next possible completion for this token. Return 0 on
@@ -115,7 +116,8 @@ struct cmdline_token_ops {
        int (*parse)(cmdline_parse_token_hdr_t *, const char *, void *,
                     unsigned int);
        /** prepare a completion on this token */
-       int (*complete_start)(cmdline_parse_token_hdr_t *, void **);
+       int (*complete_start)(cmdline_parse_token_hdr_t *, const char *,
+                             void **);
        /** fill dstbuf for this token (token, opaque, dstbuf, size) */
        int (*complete_iterate)(cmdline_parse_token_hdr_t *, void **, char *,
                                unsigned int);