From: Andre Noll Date: Mon, 7 Sep 2015 20:30:31 +0000 (+0200) Subject: play: Convert com_prev() to lopsub. X-Git-Tag: v0.6.0~2^2~48 X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=commitdiff_plain;h=f4c330d6693eb3da840d9f2f8210997095987956 play: Convert com_prev() to lopsub. The arg count check can be removed from the command handler, and the pointless help text of the commit has been removed because it said more or less the same as the summary text. --- diff --git a/m4/lls/play_cmd.suite.m4 b/m4/lls/play_cmd.suite.m4 index e62bb000..adb7e12e 100644 --- a/m4/lls/play_cmd.suite.m4 +++ b/m4/lls/play_cmd.suite.m4 @@ -22,3 +22,6 @@ caption = list of commands [/description] [subcommand next] purpose = load the next file of the playlist + +[subcommand prev] + purpose = load the previous file of the playlist diff --git a/play.c b/play.c index ce10a56b..e0ff2405 100644 --- a/play.c +++ b/play.c @@ -907,13 +907,11 @@ static int com_pause(struct play_task *pt, int argc, __a_unused char **argv) return 0; } -static int com_prev(struct play_task *pt, int argc, __a_unused char **argv) - +static int com_prev(struct play_task *pt, + __a_unused struct lls_parse_result *lpr) { int ret; - if (argc != 1) - return -E_PLAY_SYNTAX; ret = previous_valid_file(pt); if (ret < 0) return ret; @@ -923,6 +921,7 @@ static int com_prev(struct play_task *pt, int argc, __a_unused char **argv) pt->start_chunk = 0; return 0; } +EXPORT_PLAY_CMD_HANDLER(prev); static int com_next(struct play_task *pt, __a_unused struct lls_parse_result *lpr) diff --git a/play.cmd b/play.cmd index 5e090b70..0cc94f95 100644 --- a/play.cmd +++ b/play.cmd @@ -2,11 +2,6 @@ BN: play SF: play.c SN: list of commands --- -N: prev -D: Load previous file. -U: prev -H: Closes the current file and loads the previous file of the playlist. ---- N: bg D: Enter input mode. U: bg