EC_COMPLETE_STRVEC(3)
β¨ EC_COMPLETE_STRVEC(3) β¨
okay bestie, welcome to the Libecoli Programmer's Manual π this one's called ec_complete_strvec and it's lowkey the moment you've been waiting for: it hands you the list of completions straight out of a string vector. no cap. π
πΈ NAME πΈ
ec_complete_strvec β get the list of completions from a string vector input π¦
β¨ SYNOPSIS β¨
#include <ecoli/complete.h>
struct ec_comp * ec_complete_strvec(
const struct ec_node *node, /* The grammar graph. */
const struct ec_strvec *strvec /* The input string vector. */
);
so like, two things go in: the grammar graph (node) and the input string vector (strvec), and a struct ec_comp * comes out the other side. iconic behavior honestly π
π DESCRIPTION π
okay so here's the tea: this function tries to complete the last element of the string vector you hand it. like, the last one. that's the whole vibe.
want a concrete example? say you're building the equivalent of the cat shell command and you want to complete with file names. the vector you pass should be ["cat", ""] β and not ["cat"]. yes bestie, that trailing empty string is doing real work, don't skip it π
and if you want to complete with files that start with "x", the vector you pass should be ["cat", "x"]. see how it works? the last element is the thing getting completed. periodt. π«Ά
now, how does the engine actually figure out the completion list? it parses the beginning of the input using the grammar graph. then the resulting parsing tree gets saved and attached to each completion group. the way that it just... keeps the receipts for every group? obsessed. π₯
the result is a ec_comp structure pointer, and inside it lives several groups of completion items. that's your whole buffet of options right there. π
β RETURN VALUE β
- on success: a pointer to the completion list. slay. π
- on error:
NULL, anderrnois set. π (not slay, but at least it tells you why)
π SEE ALSO π
the whole friend group, fr fr β go read these too:
ec_comp_add_item(3)ec_comp_count(3)ec_comp_item_set_str(3)ec_complete(3)ec_comp_get_attrs(3)ec_comp_group_get_attrs(3)ec_comp_iter_next(3)ec_comp_item_get_node(3)ec_comp_iter_first(3)ec_comp_item_get_current(3)ec_comp_group_get_node(3)ec_complete_strvec_expand(3)ec_comp_free(3)ec_comp_get_cur_pstate(3)ec_complete_unknown(3)ec_comp_item_get_grp(3)ec_comp_item_get_type(3)ec_comp_item_get_str(3)ec_comp_item_set_display(3)ec_complete_child(3)ec_comp(3)ec_comp_item_get_display(3)ec_comp_item_get_completion(3)ec_comp_group_get_pstate(3)ec_comp_dump(3)ec_comp_merge(3)ec_comp_item_set_completion(3)ec_comp_get_cur_group(3)
π COPYRIGHT π
Copyright (C) 2010-2026 Olivier Matz, Robin Jarry.
and that's a wrap bestie!! this page is from libecoli, dated 2026-06-11, and it's literally EC_COMPLETE_STRVEC(3). go complete something cute, ily π¦πβ¨
π¦ where this page comes from
- fedora 44: libecoli-devel 0.11.7-1.fc44 Β· BSD-3-Clause AND LicenseRef-Fedora-Public-Domain
- fedora 44: libecoli-devel 0.11.7-1.fc44 Β· BSD-3-Clause AND LicenseRef-Fedora-Public-Domain
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms