X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=lib%2Fmain-readline.c;h=5bbe18e7a08977816a4a49781c5bfd6e6c96eb9f;hb=ff1f48e335ca77cc97e49ea86b292233731ecb78;hp=87653f7faaf3c9b28b14b9d1f23b07043cf6c933;hpb=07da7f3238a980f1aa9654c2d084a24e00e48e90;p=protos%2Flibecoli.git diff --git a/lib/main-readline.c b/lib/main-readline.c index 87653f7..5bbe18e 100644 --- a/lib/main-readline.c +++ b/lib/main-readline.c @@ -58,6 +58,8 @@ static char *my_completion_entry(const char *s, int state) static struct ec_completed *c; static struct ec_completed_iter *iter; const struct ec_completed_item *item; + enum ec_completed_type item_type; + const char *item_str, *item_display; (void)s; @@ -90,23 +92,26 @@ static char *my_completion_entry(const char *s, int state) if (item == NULL) return NULL; + item_str = ec_completed_item_get_str(item); if (c->count_match == 1) { /* don't add the trailing space for partial completions */ if (state == 0) { - if (item->type == EC_MATCH) + item_type = ec_completed_item_get_type(item); + if (item_type == EC_MATCH) rl_completion_suppress_append = 0; else rl_completion_suppress_append = 1; } - return strdup(item->str); + return strdup(item_str); } else if (rl_completion_type == '?') { /* on second try only show the display part */ - return strdup(item->display); + item_display = ec_completed_item_get_display(item); + return strdup(item_display); } - return strdup(item->str); + return strdup(item_str); } static char **my_attempted_completion(const char *text, int start, int end) @@ -123,13 +128,15 @@ static char **my_attempted_completion(const char *text, int start, int end) /* this function builds the help string */ static char *get_node_help(const struct ec_completed_node *compnode) { - const struct ec_completed_item *item; - const struct ec_node *node; +// const struct ec_completed_item *item; +// const struct ec_node *node; char *help = NULL; const char *node_help = NULL; const char *node_desc = NULL; - size_t i; +// size_t i; + (void)compnode; +#if 0 //XXX /* Since we display only one help per node, only look at the first item * to get the path. The objective is to retrieve the most precise * help for this node. */ @@ -141,6 +148,7 @@ static char *get_node_help(const struct ec_completed_node *compnode) if (node_desc == NULL) node_desc = ec_node_desc(node); } +#endif if (node_help == NULL) node_help = "";