X-Git-Url: https://git.draconx.ca/gitweb/cdecl99.git/blobdiff_plain/f2f75f25ecc377fb95877449aa12314ee1385a1f..21bc2db0ec83b235caec38d42f4d0812f473d766:/src/execute.gperf diff --git a/src/execute.gperf b/src/execute.gperf index 5f6740e..ddebd5d 100644 --- a/src/execute.gperf +++ b/src/execute.gperf @@ -24,6 +24,7 @@ #include "cdecl99.h" #include "commands.h" +#include "help.h" typedef #if STRTAB_MAX_OFFSET < UINT_LEAST8_MAX @@ -76,13 +77,13 @@ static int run_cmd_help(void) w = 0; } - print_block(gettext(strtab+c->cmd), 15, w); + help_print_desc(NULL, gettext(strtab+c->cmd), 15, w); } return 0; } -int run_command(const char *line, int interactive) +int run_command(const char *line, int batch) { const char *cmd = line + strspn(line, " \t"); const char *arg = cmd + strcspn(cmd, " \t"); @@ -94,9 +95,8 @@ int run_command(const char *line, int interactive) c = in_word_set(cmd, arg-cmd); if (!c) { - fprintf(stderr, _("unknown command %.*s\n"), - (int)(arg-cmd), cmd); - if (interactive) { + print_error(_("unknown command %.*s"), (int)(arg-cmd), cmd); + if (!batch) { fprintf(stderr, "%s\n", _("Try \"help\" for a list of possible commands.")); }