elua: geometry and size parsing support in getopt
authorDaniel Kolesa <quaker66@gmail.com>
Mon, 28 Apr 2014 09:47:01 +0000 (10:47 +0100)
committerDaniel Kolesa <d.kolesa@samsung.com>
Tue, 10 Jun 2014 14:48:49 +0000 (15:48 +0100)
src/bin/elua/modules/getopt.lua

index ec4dbe8..40f1ebc 100644 (file)
@@ -160,4 +160,12 @@ M.help = function(parser, f)
     end
 end
 
+M.geometry_parse = function(v)
+    return v:match("^(%d+):(%d+):(%d+):(%d+)$")
+end
+
+M.size_parse = function(v)
+    return v:match("^(%d+)x(%d+)$")
+end
+
 return M
\ No newline at end of file