]> git.tuebingen.mpg.de Git - paraslash.git/commitdiff
play: Convert com_fg() to lopsub.
authorAndre Noll <maan@tuebingen.mpg.de>
Mon, 28 Mar 2016 04:04:56 +0000 (04:04 +0000)
committerAndre Noll <maan@tuebingen.mpg.de>
Sun, 26 Mar 2017 09:02:28 +0000 (11:02 +0200)
Lopsub fails to parse the command line if one or more arguments are
given, allowing to remove the check from the command handler.

The commit also extends the help text of the subcommand to mention
that the colon key can also be used to return to input mode.

m4/lls/play_cmd.suite.m4
play.c
play.cmd

index 50727c94e81981a06f3f23fb64680ed100d9327f..d0e50261d3f5fcfe191f2a47b689adf0a3cfa298 100644 (file)
@@ -14,3 +14,9 @@ caption = list of commands
                as first argument, it prints the description of this command.
        [/description]
 
+[subcommand fg]
+       purpose = enter command mode
+       [description]
+               In this mode, file name and play time of the current audio file are
+               displayed. Hit CTRL+C or : to switch to input mode.
+       [/description]
diff --git a/play.c b/play.c
index 6fe66678cc1cb2ef49681cf16355e55cc79b4d5c..996734f4b3138fe71bc3c5c4fd42e8ce4f766849 100644 (file)
--- a/play.c
+++ b/play.c
@@ -940,13 +940,13 @@ static int com_next(struct play_task *pt, int argc, __a_unused char **argv)
        return 0;
 }
 
-static int com_fg(struct play_task *pt, int argc, __a_unused char **argv)
+static int com_fg(struct play_task *pt,
+               __a_unused struct lls_parse_result *lpr)
 {
-       if (argc != 1)
-               return -E_PLAY_SYNTAX;
        pt->background = false;
        return 0;
 }
+EXPORT_PLAY_CMD_HANDLER(fg);
 
 static int com_bg(struct play_task *pt, int argc, __a_unused char **argv)
 {
index 85b1421100c51ce3b0d4b64d4a598c5f298b6656..ec5373b60d8d80d0d162a274a73af5f607e58610 100644 (file)
--- a/play.cmd
+++ b/play.cmd
@@ -12,12 +12,6 @@ D: Load previous file.
 U: prev
 H: Closes the current file and loads the previous file of the playlist.
 ---
-N: fg
-D: Enter command mode.
-U: fg
-H: In this mode, file name and play time are displayed.  Hit CTRL+C to switch to
-H: input mode.
----
 N: bg
 D: Enter input mode.
 U: bg