Implement option usage/parsing in rc.lua.

This commit is contained in:
Antoine Cellerier 2009-01-17 15:47:51 +01:00
parent 74d68fbd7a
commit b22bd1b31c

View File

@ -155,14 +155,18 @@ function quit(name,client)
end
function add(name,client,arg)
-- TODO: parse (and use) options
local f
if name == "enqueue" then
f = vlc.playlist.enqueue
else
f = vlc.playlist.add
end
f({{path=arg}})
local options = {}
for o in string.gmatch(arg," +:([^ ]*)") do
table.insert(options,o)
end
arg = string.gsub(arg," +:.*$","")
f({{path=arg,options=options}})
end
function playlist_is_tree( client )