]> git.draconx.ca Git - cdecl99.git/blobdiff - src/execute.gperf
libcdecl: Use Bison's api.token.raw feature.
[cdecl99.git] / src / execute.gperf
index b1e7d5931ee2e4746c3c04bf80050cb1ab6583c6..ddebd5d08867d246ef5fea503da0fc33936bd315 100644 (file)
@@ -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");
@@ -95,7 +96,7 @@ int run_command(const char *line, int interactive)
        c = in_word_set(cmd, arg-cmd);
        if (!c) {
                print_error(_("unknown command %.*s"), (int)(arg-cmd), cmd);
-               if (interactive) {
+               if (!batch) {
                        fprintf(stderr, "%s\n",
                                _("Try \"help\" for a list of possible commands."));
                }