]> git.tuebingen.mpg.de Git - paraslash.git/blobdiff - play.c
play: Remove support for non-lopsub commands.
[paraslash.git] / play.c
diff --git a/play.c b/play.c
index c6a785980e93be6cd9fa558ee70dc0b5dfb4e65f..1ab4010160cac7e22988111d361de5e745dcd75c 100644 (file)
--- a/play.c
+++ b/play.c
@@ -665,22 +665,6 @@ static char **get_mapped_keyseqs(void)
        return result;
 }
 
-#include "play.command_list.h"
-
-typedef int play_command_handler_t(struct play_task *, int, char**);
-
-/* defines one command of para_play */
-struct pp_command {
-       const char *name;
-       play_command_handler_t *handler;
-       const char *description;
-       const char *usage;
-       const char *help;
-};
-
-static struct pp_command pp_cmds[] = {DEFINE_PLAY_CMD_ARRAY};
-#define FOR_EACH_COMMAND(c) for (c = 0; pp_cmds[c].name; c++)
-
 static struct i9e_completer pp_completers[];
 
 I9E_DUMMY_COMPLETER(jmp);
@@ -755,11 +739,6 @@ static int com_help(struct play_task *pt, struct lls_parse_result *lpr)
                                        lls_command_name(cmd), lls_purpose(cmd));
                                btr_add_output(buf, sz, pt->btrn);
                        }
-                       FOR_EACH_COMMAND(i) {
-                               sz = xasprintf(&buf, "%s\t%s\n", pp_cmds[i].name,
-                               pp_cmds[i].description);
-                               btr_add_output(buf, sz, pt->btrn);
-                       }
                        return 0;
                }
                FOR_EACH_MAPPED_KEY(i) {
@@ -1015,7 +994,7 @@ EXPORT_PLAY_CMD_HANDLER(ff);
 
 static int run_command(char *line, struct play_task *pt)
 {
-       int i, ret, argc;
+       int ret, argc;
        char **argv = NULL;
        char *errctx = NULL;
        const struct play_command_info *pci;
@@ -1029,26 +1008,16 @@ static int run_command(char *line, struct play_task *pt)
        if (ret == 0)
                goto out;
        argc = ret;
-
        ret = lls(lls_lookup_subcmd(argv[0], play_cmd_suite, &errctx));
-       if (ret >= 0) {
-               cmd = lls_cmd(ret, play_cmd_suite);
-               ret = lls(lls_parse(argc, argv, cmd, &lpr, &errctx));
-               if (ret < 0)
-                       goto out;
-               pci = lls_user_data(cmd);
-               ret = pci->handler(pt, lpr);
-               lls_free_parse_result(lpr, cmd);
-       } else {
-               FOR_EACH_COMMAND(i) {
-                       if (strcmp(pp_cmds[i].name, argv[0]))
-                               continue;
-                       free(errctx);
-                       errctx = NULL;
-                       ret = pp_cmds[i].handler(pt, argc, argv);
-                       break;
-               }
-       }
+       if (ret < 0)
+               goto out;
+       cmd = lls_cmd(ret, play_cmd_suite);
+       ret = lls(lls_parse(argc, argv, cmd, &lpr, &errctx));
+       if (ret < 0)
+               goto out;
+       pci = lls_user_data(cmd);
+       ret = pci->handler(pt, lpr);
+       lls_free_parse_result(lpr, cmd);
 out:
        if (errctx)
                PARA_ERROR_LOG("%s\n", errctx);