[vlc-devel] commit: Implement option usage/parsing in rc.lua. (Antoine Cellerier )
git version control
git at videolan.org
Sat Jan 17 16:09:48 CET 2009
vlc | branch: master | Antoine Cellerier <dionoea at videolan.org> | Sat Jan 17 15:47:51 2009 +0100| [b22bd1b31c3504894284ac49b47a8f8ff6d0ecf5] | committer: Antoine Cellerier
Implement option usage/parsing in rc.lua.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=b22bd1b31c3504894284ac49b47a8f8ff6d0ecf5
---
share/lua/intf/rc.lua | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/share/lua/intf/rc.lua b/share/lua/intf/rc.lua
index 191f919..7a4316c 100644
--- a/share/lua/intf/rc.lua
+++ b/share/lua/intf/rc.lua
@@ -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 )
More information about the vlc-devel
mailing list