mpd: allow named keys or positional arguments
Signed-off-by: Adrian C. (anrxc) <anrxc@sysphere.org>
This commit is contained in:
parent
729ceb7865
commit
06e8f7c68a
|
@ -30,9 +30,9 @@ local function worker(format, warg)
|
||||||
}
|
}
|
||||||
|
|
||||||
-- Fallback to MPD defaults
|
-- Fallback to MPD defaults
|
||||||
local pass = warg and warg[1] or "\"\""
|
local pass = warg and (warg.password or warg[1]) or "\"\""
|
||||||
local host = warg and warg[2] or "127.0.0.1"
|
local host = warg and (warg.host or warg[2]) or "127.0.0.1"
|
||||||
local port = warg and warg[3] or "6600"
|
local port = warg and (warg.port or warg[3]) or "6600"
|
||||||
|
|
||||||
-- Construct MPD client options
|
-- Construct MPD client options
|
||||||
local mpdh = "telnet://"..host..":"..port
|
local mpdh = "telnet://"..host..":"..port
|
||||||
|
|
Loading…
Reference in New Issue