]> git.sesse.net Git - vlc/commitdiff
Implement option usage/parsing in rc.lua.
authorAntoine Cellerier <dionoea@videolan.org>
Sat, 17 Jan 2009 14:47:51 +0000 (15:47 +0100)
committerAntoine Cellerier <dionoea@videolan.org>
Sat, 17 Jan 2009 14:47:51 +0000 (15:47 +0100)
share/lua/intf/rc.lua

index 191f919e8cdb31b8028d5b1fbb5c3353753e0e83..7a4316c227ac6a6d7456dfa04cb64f15425a2e9c 100644 (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 )