From a2a5fa454565e7e7ca11721ec9d1935a9fccf168 Mon Sep 17 00:00:00 2001 From: Philip Sequeira Date: Sun, 5 Mar 2017 16:47:36 -0500 Subject: [PATCH] options: add M_OPT_FILE to some more file options (Helps shell completion.) --- audio/out/ao_pcm.c | 2 +- common/encode_lavc.c | 2 +- options/options.c | 6 +++--- video/filter/vf_vapoursynth.c | 2 +- video/out/opengl/lcms.c | 4 ++-- video/out/opengl/video.c | 2 +- video/out/vo_image.c | 2 +- 7 files changed, 10 insertions(+), 10 deletions(-) diff --git a/audio/out/ao_pcm.c b/audio/out/ao_pcm.c index 4e5ec0a319..0ef99bc411 100644 --- a/audio/out/ao_pcm.c +++ b/audio/out/ao_pcm.c @@ -219,7 +219,7 @@ const struct ao_driver audio_out_pcm = { .priv_size = sizeof(struct priv), .priv_defaults = &(const struct priv) { .waveheader = 1 }, .options = (const struct m_option[]) { - OPT_STRING("file", outputfilename, 0), + OPT_STRING("file", outputfilename, M_OPT_FILE), OPT_FLAG("waveheader", waveheader, 0), OPT_FLAG("append", append, 0), {0} diff --git a/common/encode_lavc.c b/common/encode_lavc.c index ee870a015a..36f1e8ac82 100644 --- a/common/encode_lavc.c +++ b/common/encode_lavc.c @@ -36,7 +36,7 @@ #define OPT_BASE_STRUCT struct encode_opts const struct m_sub_options encode_config = { .opts = (const m_option_t[]) { - OPT_STRING("o", file, M_OPT_FIXED | CONF_NOCFG | CONF_PRE_PARSE), + OPT_STRING("o", file, M_OPT_FIXED | CONF_NOCFG | CONF_PRE_PARSE | M_OPT_FILE), OPT_STRING("of", format, M_OPT_FIXED), OPT_STRINGLIST("ofopts*", fopts, M_OPT_FIXED), OPT_FLOATRANGE("ofps", fps, M_OPT_FIXED, 0.0, 1000000.0), diff --git a/options/options.c b/options/options.c index 012707cb2c..0cb653c4a9 100644 --- a/options/options.c +++ b/options/options.c @@ -305,7 +305,7 @@ const m_option_t mp_opts[] = { #endif OPT_FLAG("config", load_config, M_OPT_FIXED | CONF_PRE_PARSE), OPT_STRING("config-dir", force_configdir, - M_OPT_FIXED | CONF_NOCFG | CONF_PRE_PARSE), + M_OPT_FIXED | CONF_NOCFG | CONF_PRE_PARSE | M_OPT_FILE), OPT_STRINGLIST("reset-on-next-file", reset_options, 0), #if HAVE_LUA @@ -618,7 +618,7 @@ const m_option_t mp_opts[] = { OPT_FLAG("save-position-on-quit", position_save_on_quit, 0), OPT_FLAG("write-filename-in-watch-later-config", write_filename_in_watch_later_config, 0), OPT_FLAG("ignore-path-in-watch-later-config", ignore_path_in_watch_later_config, 0), - OPT_STRING("watch-later-directory", watch_later_directory, 0), + OPT_STRING("watch-later-directory", watch_later_directory, M_OPT_FILE), OPT_FLAG("ordered-chapters", ordered_chapters, 0), OPT_STRING("ordered-chapters-files", ordered_chapters_files, M_OPT_FILE), @@ -686,7 +686,7 @@ const m_option_t mp_opts[] = { OPT_SUBSTRUCT("screenshot", screenshot_image_opts, screenshot_conf, 0), OPT_STRING("screenshot-template", screenshot_template, 0), - OPT_STRING("screenshot-directory", screenshot_directory, 0), + OPT_STRING("screenshot-directory", screenshot_directory, M_OPT_FILE), OPT_STRING("record-file", record_file, M_OPT_FILE), diff --git a/video/filter/vf_vapoursynth.c b/video/filter/vf_vapoursynth.c index 625d539dc4..33a586c024 100644 --- a/video/filter/vf_vapoursynth.c +++ b/video/filter/vf_vapoursynth.c @@ -736,7 +736,7 @@ static int vf_open(vf_instance_t *vf) #define OPT_BASE_STRUCT struct vf_priv_s static const m_option_t vf_opts_fields[] = { - OPT_STRING("file", cfg_file, 0), + OPT_STRING("file", cfg_file, M_OPT_FILE), OPT_INTRANGE("buffered-frames", cfg_maxbuffer, 0, 1, 9999, OPTDEF_INT(4)), OPT_CHOICE_OR_INT("concurrent-frames", cfg_maxrequests, 0, 1, 99, ({"auto", -1}), OPTDEF_INT(-1)), diff --git a/video/out/opengl/lcms.c b/video/out/opengl/lcms.c index 5bd19547f1..cabcb16954 100644 --- a/video/out/opengl/lcms.c +++ b/video/out/opengl/lcms.c @@ -77,9 +77,9 @@ static int validate_3dlut_size_opt(struct mp_log *log, const m_option_t *opt, #define OPT_BASE_STRUCT struct mp_icc_opts const struct m_sub_options mp_icc_conf = { .opts = (const m_option_t[]) { - OPT_STRING("icc-profile", profile, 0), + OPT_STRING("icc-profile", profile, M_OPT_FILE), OPT_FLAG("icc-profile-auto", profile_auto, 0), - OPT_STRING("icc-cache-dir", cache_dir, 0), + OPT_STRING("icc-cache-dir", cache_dir, M_OPT_FILE), OPT_INT("icc-intent", intent, 0), OPT_INTRANGE("icc-contrast", contrast, 0, 0, 100000), OPT_STRING_VALIDATE("icc-3dlut-size", size_str, 0, validate_3dlut_size_opt), diff --git a/video/out/opengl/video.c b/video/out/opengl/video.c index 3a19858953..a9ee6ea503 100644 --- a/video/out/opengl/video.c +++ b/video/out/opengl/video.c @@ -380,7 +380,7 @@ const struct m_sub_options gl_video_conf = { ({"no", BLEND_SUBS_NO}, {"yes", BLEND_SUBS_YES}, {"video", BLEND_SUBS_VIDEO})), - OPT_STRINGLIST("opengl-shaders", user_shaders, 0), + OPT_STRINGLIST("opengl-shaders", user_shaders, M_OPT_FILE), OPT_FLAG("deband", deband, 0), OPT_SUBSTRUCT("deband", deband_opts, deband_conf, 0), OPT_FLOAT("sharpen", unsharp, 0), diff --git a/video/out/vo_image.c b/video/out/vo_image.c index e1bc1aab20..fd3efde253 100644 --- a/video/out/vo_image.c +++ b/video/out/vo_image.c @@ -57,7 +57,7 @@ struct vo_image_opts { static const struct m_sub_options vo_image_conf = { .opts = (const struct m_option[]) { OPT_SUBSTRUCT("vo-image", opts, image_writer_conf, 0), - OPT_STRING("vo-image-outdir", outdir, 0), + OPT_STRING("vo-image-outdir", outdir, M_OPT_FILE), {0}, }, .size = sizeof(struct vo_image_opts),