From 91583fccac85880ad2199f50463c095560791d56 Mon Sep 17 00:00:00 2001 From: wm4 Date: Fri, 30 Jun 2017 16:39:36 +0200 Subject: options: change path list options, and document list options The changes to path list options is basically getting rid of the need to pass multiple paths to a single option. Instead, you can use the option multiple times. The old behavior can be used by using the -set suffix with the option. Change some options to path lists. For example --script is now append by default, and if you use --script-set, you need to use ":"/";" as separator instead of ",". --sub-paths/--audio-file-paths is a deprecated alias now, and will break if the user tries to pass multiple paths to it. I'm assuming that if these are used, most users will pass only 1 path anyway. --opengl-shaders has more compatibility handling, since it's probably rather common that users pass multiple options to it. Also document all that in the manpage. I'll probably regret this later, as it somewhat increases the complexity of the option parser, rather than increasing it. --- options/options.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'options/options.c') diff --git a/options/options.c b/options/options.c index 3827709dcc..02dc5e94dd 100644 --- a/options/options.c +++ b/options/options.c @@ -289,7 +289,7 @@ const m_option_t mp_opts[] = { OPT_STRINGLIST("reset-on-next-file", reset_options, 0), #if HAVE_LUA || HAVE_JAVASCRIPT - OPT_STRINGLIST("script", script_files, M_OPT_FIXED | M_OPT_FILE), + OPT_PATHLIST("script", script_files, M_OPT_FIXED), OPT_KEYVALUELIST("script-opts", script_opts, 0), OPT_FLAG("load-scripts", auto_load_scripts, 0), #endif @@ -375,7 +375,7 @@ const m_option_t mp_opts[] = { #endif // demuxer.c - select audio/sub file/demuxer - OPT_STRING_APPEND_LIST("audio-file", audio_files, M_OPT_FILE), + OPT_PATHLIST("audio-file", audio_files, 0), OPT_STRING("demuxer", demuxer_name, 0), OPT_STRING("audio-demuxer", audio_demuxer_name, 0), OPT_STRING("sub-demuxer", sub_demuxer_name, 0), @@ -459,10 +459,10 @@ const m_option_t mp_opts[] = { // ------------------------- subtitles options -------------------- - OPT_STRING_APPEND_LIST("sub-file", sub_name, M_OPT_FILE), - OPT_PATHLIST("sub-paths", sub_paths, 0), - OPT_PATHLIST("audio-file-paths", audiofile_paths, 0), - OPT_STRING_APPEND_LIST("external-file", external_files, M_OPT_FILE), + OPT_PATHLIST("sub-file", sub_name, 0), + OPT_PATHLIST("sub-file-path", sub_paths, 0), + OPT_PATHLIST("audio-file-path", audiofile_paths, 0), + OPT_PATHLIST("external-file", external_files, 0), OPT_FLAG("autoload-files", autoload_files, 0), OPT_FLOAT("sub-delay", sub_delay, UPDATE_OSD), OPT_FLOAT("sub-fps", sub_fps, UPDATE_OSD), @@ -832,6 +832,10 @@ const m_option_t mp_opts[] = { OPT_REMOVED("fs-black-out-screens", NULL), OPT_REPLACED_MSG("loop", "loop-playlist", "--loop will be changed to map to" " --loop-file in future releases."), + OPT_REPLACED_MSG("sub-paths", "sub-file-path", + "passing multiple paths works differently now"), + OPT_REPLACED_MSG("audio-file-paths", "audio-file-path", + "passing multiple paths works differently now"), {0} }; -- cgit v1.2.3