1 - token file/path: pour ca il faut changer la logique get_nb/complete
2 pour se rapprocher du opendir/readdir
4 - better example than calculator
5 - check all XXX in code
7 - too much possible completion
8 - token string entre guillemets ?
9 - cmdline_parse() n'a pas besoin de retourner tokenlen
10 - les help() des tokens (string par ex) ne retournent pas "faux" en cas d'erreur
11 - on pourrait virer la valeur de retour du start() en reorganisant
12 cmdline_parse() et cmdline_help()
13 - genconf: completion des xpath //
14 - supprimer tous les basic_char_loop()
20 - rdline: API peut rester comme ca
21 doit pouvoir etre utiisé seule
25 doit aussi pouvoir etre utilisé seule
26 il faut virer les references a cmdline/rdline
28 /* opaque is given to the token callback func */
29 int cmdline_parse(parse_ctx, const char *buf, void *opaque);
32 cmdline_complete_init(cmplt_ctx)
35 * complete() must be called with an initialized context
36 * with *state==-1 (just display choices), then called until it
37 * returns CMDLINE_PARSE_COMPLETED_BUFFER or
38 * CMDLINE_PARSE_COMPLETE_FINISHED.
40 * It returns < 0 on error.
43 * - CMDLINE_PARSE_COMPLETED_BUFFER on completion (one possible
44 * choice). In this case, the chars are appended in dst buffer.
45 * - CMDLINE_PARSE_COMPLETE_AGAIN if there is several possible
46 * choices. In this case, you must call the function again with
48 * - CMDLINE_PARSE_COMPLETE_FINISHED when the iteration is
49 * finished. The dst is not valid for this last call.
51 * The returned dst buf ends with \0.
53 int cmdline_complete(parse_ctx, const char *buf, cmplt_ctx,
54 char *dst, unsigned int size);
57 - cmdline est un assemblage de rdline et parse
58 permet de parser des fichiers, de faire un prompt sur stdin, network, unix
73 complete = "toto", complete_len = 4
74 complete = "tot", complete_len = 3
75 complete = "t", complete_len = 1
76 complete = "", complete_len = 0
80 "t" -> "toto" "toti" "titi" (help)
82 complete = "toto", complete_len = 4
83 complete = "tot", complete_len = 3
84 complete = "t", complete_len = 1
87 "to" -> "tot" (complete, not finished)
89 complete = "toto", complete_len = 4
90 complete = "tot", complete_len = 3
93 "ti" -> "titi " (complete, finished)