diff options
author | Mika Havela <mika.havela@gmail.com> | 2008-01-24 14:57:29 +0000 |
---|---|---|
committer | Mika Havela <mika.havela@gmail.com> | 2008-01-24 14:57:29 +0000 |
commit | 90bd6e0c226ab316643fe0e1ffad2496c0d1948d (patch) | |
tree | 14c71dd2b611f736a6190e6d538f2b4392eeaa2a /lib/getopts.lua | |
parent | 8ca88e4ba817144acf9f81a4f51b8f3836a4d6b4 (diff) | |
download | acf-core-90bd6e0c226ab316643fe0e1ffad2496c0d1948d.tar.bz2 acf-core-90bd6e0c226ab316643fe0e1ffad2496c0d1948d.tar.xz |
Minor changes on tables
git-svn-id: svn://svn.alpinelinux.org/acf/core/trunk@636 ab2d0c66-481e-0410-8bed-d214d4d58bed
Diffstat (limited to 'lib/getopts.lua')
-rw-r--r-- | lib/getopts.lua | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/getopts.lua b/lib/getopts.lua index 84a8fa8..4aa433c 100644 --- a/lib/getopts.lua +++ b/lib/getopts.lua @@ -38,7 +38,7 @@ function opts_to_table ( optstring, filter ) local option = "" local optvalue = "" for j = 1, string.len(optstr) do - if (string.sub(optstr, j, j) == " -") then + if (string.sub(optstr, j, j) == "-") then option=string.sub(optstr, j, j+1) if not (filter) or (filter == option) then for k = j+1, string.len(optstr) do @@ -46,11 +46,11 @@ function opts_to_table ( optstring, filter ) optsparams = {} end if (string.sub(optstr, k, k) == "-") then - optsparams[option] = string.match(string.sub(optstr, j+2, k-1),"^%s*(.*)%s?") + optsparams[option] = string.match(string.sub(optstr, j+2, k-1),"^%s*(.-)%s*$") break end if (k == string.len(optstr)) then - optsparams[option] = string.match(string.sub(optstr, j+2, k),"^%s*(.*)%s?") + optsparams[option] = string.match(string.sub(optstr, j+2, k),"^%s*(.-)%s*$") break end end |