#define _GNU_SOURCE /* for asprintf */
#include <stdlib.h>
#include <stdio.h>
+#include <errno.h>
#include <assert.h>
#include <readline/readline.h>
#include <readline/history.h>
+#include <ecoli_init.h>
#include <ecoli_node.h>
#include <ecoli_parsed.h>
#include <ecoli_completed.h>
{
static struct ec_completed *c;
static struct ec_completed_iter *iter;
- static const struct ec_completed_item *item;
+ const struct ec_completed_item *item;
(void)s;
helps[i++] = get_node_help(compnode);
}
- ec_completed_dump(stdout, c);
ec_completed_free(c);
rl_display_match_list(helps, count + match, 1000); /* XXX 1000 */
ec_keyval_set(ec_node_attrs(ec_node_find(cmd, "name")), "help",
"the person to greet", NULL);
ec_keyval_set(ec_node_attrs(ec_node_find(cmd, "count")), "help",
- "how many times to greet", NULL);
+ "how many times to greet (0-10)", NULL);
if (ec_node_or_add(cmdlist, cmd) < 0)
goto fail;
struct ec_parsed *p;
char *line;
+ if (ec_init() < 0) {
+ fprintf(stderr, "cannot init ecoli: %s\n", strerror(errno));
+ return 1;
+ }
+
if (create_commands() < 0)
return 1;