mirror of
https://github.com/mpv-player/mpv
synced 2025-03-11 08:37:59 +00:00
player: add option-info/<name>/expects-file
This will allow console.lua to complete files after e.g. set glsl-shaders <Tab>.
This commit is contained in:
parent
4e5845ad03
commit
c4b03700e1
1
DOCS/interface-changes/option-info-expects-file.txt
Normal file
1
DOCS/interface-changes/option-info-expects-file.txt
Normal file
@ -0,0 +1 @@
|
||||
add "option-info/<name>/expects-file" sub-property
|
@ -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.
|
||||
|
||||
|
@ -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)},
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user