options: add --version

This commit is contained in:
wm4 2013-05-15 15:14:24 +02:00
parent 4930681e7a
commit 894288457b
3 changed files with 14 additions and 0 deletions

View File

@ -2401,6 +2401,9 @@
*NOTE*: See ``--vd=help`` for a full list of available decoders.
--version
Print version string and exit.
--vf=<filter1[=parameter1:parameter2:...],filter2,...>
Specify a list of video filters to apply to the video stream. See
`video_filters` for details and descriptions of the available filters.

View File

@ -55,6 +55,9 @@ extern const m_option_t cdda_opts[];
extern int sws_flags;
extern const char pp_help[];
static int print_version_opt(const m_option_t *opt, const char *name,
const char *param);
#ifdef CONFIG_RADIO
const m_option_t radioopts_conf[]={
{"device", &stream_radio_defaults.device, CONF_TYPE_STRING, 0, 0 ,0, NULL},
@ -699,6 +702,7 @@ const m_option_t mplayer_opts[]={
{"identify", &mp_msg_levels[MSGT_IDENTIFY], CONF_TYPE_FLAG, CONF_GLOBAL, 0, MSGL_V, NULL},
{"help", (void *) help_text, CONF_TYPE_PRINT, CONF_NOCFG|CONF_GLOBAL, 0, 0, NULL},
{"h", (void *) help_text, CONF_TYPE_PRINT, CONF_NOCFG|CONF_GLOBAL, 0, 0, NULL},
{"version", (void *)print_version_opt, CONF_TYPE_PRINT_FUNC, CONF_NOCFG|CONF_GLOBAL|M_OPT_PRE_PARSE},
#ifdef CONFIG_ENCODING
OPT_STRING("o", encode_output.file, CONF_GLOBAL),

View File

@ -4566,6 +4566,13 @@ static void print_version(int always)
"%s (C) 2000-2013 mpv/MPlayer/mplayer2 projects\n built on %s\n", mplayer_version, mplayer_builddate);
}
static int print_version_opt(const m_option_t *opt, const char *name,
const char *param)
{
print_version(true);
exit(0);
}
static bool handle_help_options(struct MPContext *mpctx)
{
struct MPOpts *opts = &mpctx->opts;