clix.lua

changeset 52
95ea1dca92ed
parent 45
36f5bf718d3c
child 70
5e93cfc73444
equal deleted inserted replaced
51:e6a408eaa825 52:95ea1dca92ed
140 140
141 local opts = {}; 141 local opts = {};
142 142
143 local command, args_handled_up_to; 143 local command, args_handled_up_to;
144 for i, opt in ipairs(arg) do 144 for i, opt in ipairs(arg) do
145 print(i, opt)
146 if opt:match("^%-") and opt ~= "--" then 145 if opt:match("^%-") and opt ~= "--" then
147 local name = opt:match("^%-%-?([^%s=]+)()") 146 local name = opt:match("^%-%-?([^%s=]+)()")
148 name = (short_opts[name] or name):gsub("%-+", "_"); 147 name = (short_opts[name] or name):gsub("%-+", "_");
149 if name:match("^no_") then 148 if name:match("^no_") then
150 name = name:sub(4, -1); 149 name = name:sub(4, -1);

mercurial