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); |