diff options
Diffstat (limited to 'parser-mpcmd.c')
-rw-r--r-- | parser-mpcmd.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/parser-mpcmd.c b/parser-mpcmd.c index b03bcfb05a..3d8b4a110f 100644 --- a/parser-mpcmd.c +++ b/parser-mpcmd.c @@ -31,7 +31,6 @@ #endif #include "mp_msg.h" -#include "help_mp.h" #include "m_option.h" #include "m_config.h" #include "playtree.h" @@ -51,7 +50,9 @@ static int mode = 0; // #define UNSET_GLOBAL (mode = GLOBAL) -static int is_entry_option(char *opt, char *param, play_tree_t** ret) { +static int is_entry_option(struct m_config *mconfig, char *opt, char *param, + play_tree_t** ret) +{ play_tree_t* entry = NULL; *ret = NULL; @@ -60,7 +61,7 @@ static int is_entry_option(char *opt, char *param, play_tree_t** ret) { if(!param) return M_OPT_MISSING_PARAM; - entry = parse_playlist_file(param); + entry = parse_playlist_file(mconfig, param); if(!entry) return -1; else { @@ -120,7 +121,7 @@ m_config_parse_mp_command_line(m_config_t *config, int argc, char **argv) no_more_opts = 1; if (i+1 >= argc) { - mp_msg(MSGT_CFGPARSER, MSGL_ERR, MSGTR_NoFileGivenOnCommandLine); + mp_tmsg(MSGT_CFGPARSER, MSGL_ERR, "'--' indicates no more options, but no filename was given on the command line.\n"); goto err_out; } continue; @@ -167,7 +168,7 @@ m_config_parse_mp_command_line(m_config_t *config, int argc, char **argv) char* end = NULL; l = (i+1<argc) ? strtol(argv[i+1],&end,0) : 0; if(!end || *end != '\0') { - mp_msg(MSGT_CFGPARSER, MSGL_ERR, MSGTR_TheLoopOptionMustBeAnInteger, argv[i+1]); + mp_tmsg(MSGT_CFGPARSER, MSGL_ERR, "The loop option must be an integer: %s\n", argv[i+1]); tmp = ERR_OUT_OF_RANGE; } else { play_tree_t* pt = last_entry ? last_entry : last_parent; @@ -189,7 +190,7 @@ m_config_parse_mp_command_line(m_config_t *config, int argc, char **argv) const m_option_t* mp_opt = NULL; play_tree_t* entry = NULL; - tmp = is_entry_option(opt,(i+1<argc) ? argv[i + 1] : NULL,&entry); + tmp = is_entry_option(config, opt,(i+1<argc) ? argv[i + 1] : NULL,&entry); if(tmp > 0) { // It's an entry if(entry) { add_entry(&last_parent,&last_entry,entry); @@ -213,7 +214,7 @@ m_config_parse_mp_command_line(m_config_t *config, int argc, char **argv) } } else { tmp = M_OPT_UNKNOWN; - mp_msg(MSGT_CFGPARSER, MSGL_ERR, MSGTR_UnknownOptionOnCommandLine, opt); + mp_tmsg(MSGT_CFGPARSER, MSGL_ERR, "Unknown option on the command line: -%s\n", opt); } } } @@ -223,7 +224,7 @@ m_config_parse_mp_command_line(m_config_t *config, int argc, char **argv) tmp = M_OPT_EXIT - tmp; } else if (tmp < 0) { - mp_msg(MSGT_CFGPARSER, MSGL_FATAL, MSGTR_ErrorParsingOptionOnCommandLine, opt); + mp_tmsg(MSGT_CFGPARSER, MSGL_FATAL, "Error parsing option on the command line: -%s\n", opt); goto err_out; } i += tmp; @@ -260,7 +261,7 @@ m_config_parse_mp_command_line(m_config_t *config, int argc, char **argv) last_entry = entry; } } else { - mp_msg(MSGT_CFGPARSER, MSGL_ERR, MSGTR_InvalidPlayEntry, argv[i]); + mp_tmsg(MSGT_CFGPARSER, MSGL_ERR, "Invalid play entry %s\n", argv[i]); } } else { // dvd:// or dvd://x entry |