lua: fix options submodule

It polluted the global namespace, instead of exporting the function
properly.

For now, keep it compatible by explicitly keeping the bogus export.

Also fix a mistake in the manpage example.
This commit is contained in:
wm4 2015-05-29 15:50:09 +02:00
parent 9fe6a8c5f5
commit 327b091909
3 changed files with 8 additions and 3 deletions

View File

@ -519,7 +519,7 @@ Example implementation::
optionC = true,
}
read_options(options, "myscript")
print(option.optionA)
print(options.optionA)
The config file will be stored in ``lua-settings/identifier.conf`` in mpv's user

View File

@ -30,7 +30,7 @@ local function typeconv(desttypeval, val)
end
function read_options(options, identifier)
local function read_options(options, identifier)
if identifier == nil then
identifier = mp.get_script_name()
end
@ -101,4 +101,9 @@ function read_options(options, identifier)
end
-- backwards compatibility with broken read_options export
_G.read_options = read_options
return {
read_options = read_options,
}

View File

@ -33,7 +33,7 @@ local user_opts = {
}
-- read options from config and command-line
read_options(user_opts, "osc")
opt.read_options(user_opts, "osc")
local osc_param = { -- calculated by osc_init()
playresy = 0, -- canvas size Y