summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--DOCS/interface-changes/option-info-expects-file.txt1
-rw-r--r--DOCS/man/input.rst3
-rw-r--r--player/command.c1
-rw-r--r--player/lua/console.lua2
4 files changed, 6 insertions, 1 deletions
diff --git a/DOCS/interface-changes/option-info-expects-file.txt b/DOCS/interface-changes/option-info-expects-file.txt
new file mode 100644
index 0000000000..c8a54da0a7
--- /dev/null
+++ b/DOCS/interface-changes/option-info-expects-file.txt
@@ -0,0 +1 @@
+add "option-info/<name>/expects-file" sub-property
diff --git a/DOCS/man/input.rst b/DOCS/man/input.rst
index e0bfadf98f..8d839cb6da 100644
--- a/DOCS/man/input.rst
+++ b/DOCS/man/input.rst
@@ -3678,6 +3678,9 @@ Property list
means the option value will be restored to the value before playback
start when playback ends.
+ ``option-info/<name>/expects-file``
+ Whether the option takes file paths as arguments.
+
``option-info/<name>/default-value``
The default value of the option. May not always be available.
diff --git a/player/command.c b/player/command.c
index 65469988d9..6cfd25b6fa 100644
--- a/player/command.c
+++ b/player/command.c
@@ -3650,6 +3650,7 @@ static int mp_property_option_info(void *ctx, struct m_property *prop,
{"type", SUB_PROP_STR(opt->type->name)},
{"set-from-commandline", SUB_PROP_BOOL(co->is_set_from_cmdline)},
{"set-locally", SUB_PROP_BOOL(co->is_set_locally)},
+ {"expects-file", SUB_PROP_BOOL(opt->flags & M_OPT_FILE)},
{"default-value", *opt, def},
{"min", SUB_PROP_DOUBLE(opt->min),
.unavailable = !(has_minmax && opt->min != DBL_MIN)},
diff --git a/player/lua/console.lua b/player/lua/console.lua
index 6b649184fd..be966008bb 100644
--- a/player/lua/console.lua
+++ b/player/lua/console.lua
@@ -934,7 +934,7 @@ local function property_list()
for _, sub_property in pairs({
'name', 'type', 'set-from-commandline', 'set-locally',
- 'default-value', 'min', 'max', 'choices',
+ 'expects-file', 'default-value', 'min', 'max', 'choices',
}) do
properties[#properties + 1] = 'option-info/' .. option .. '/' ..
sub_property