Guest User

Untitled

a guest
Apr 27th, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.43 KB | None | 0 0
  1. -------------------------------------------------
  2. function ParseArguments(s)
  3.  
  4.     if type(s) ~= "string" then
  5.  
  6.         return nil
  7.  
  8.     end
  9.  
  10.     local args = string.split(cmdline)
  11.  
  12.     for index,arg in ipairs(arg) do
  13.  
  14.         if string.startswith(arg, "\"") and string.endswith(arg, "\"") then
  15.  
  16.             args[index] = string.sub(arg, 2, -2)
  17.  
  18.         elseif tonumber(arg) ~= nil then
  19.  
  20.             args[index] = tonumber(arg)
  21.  
  22.         end
  23.  
  24.     end
  25.  
  26.     return args
  27.  
  28. end
Add Comment
Please, Sign In to add comment