diff options
Diffstat (limited to 'tools/migration')
-rw-r--r-- | tools/migration/prosody-migrator.lua | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/tools/migration/prosody-migrator.lua b/tools/migration/prosody-migrator.lua index 85234745..7ceff721 100644 --- a/tools/migration/prosody-migrator.lua +++ b/tools/migration/prosody-migrator.lua @@ -16,19 +16,18 @@ local default_config = (CFG_CONFIGDIR or ".").."/migrator.cfg.lua"; -- Command-line parsing local options = {}; -local handled_opts = 0; -for i = 1, #arg do +local i = 1; +while arg[i] do if arg[i]:sub(1,2) == "--" then local opt, val = arg[i]:match("([%w-]+)=?(.*)"); if opt then options[(opt:sub(3):gsub("%-", "_"))] = #val > 0 and val or true; end - handled_opts = i; + table.remove(arg, i); else - break; + i = i + 1; end end -table.remove(arg, handled_opts); if CFG_SOURCEDIR then package.path = CFG_SOURCEDIR.."/?.lua;"..package.path; |