From: Andre Noll Date: Mon, 28 Mar 2016 04:04:56 +0000 (+0000) Subject: play: Convert com_fg() to lopsub. X-Git-Tag: v0.6.0~2^2~50 X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=commitdiff_plain;h=575aa063581ddfae4af105cea6066c165e9faf1d play: Convert com_fg() to lopsub. 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. --- diff --git a/m4/lls/play_cmd.suite.m4 b/m4/lls/play_cmd.suite.m4 index 50727c94..d0e50261 100644 --- a/m4/lls/play_cmd.suite.m4 +++ b/m4/lls/play_cmd.suite.m4 @@ -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 6fe66678..996734f4 100644 --- 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) { diff --git a/play.cmd b/play.cmd index 85b14211..ec5373b6 100644 --- 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