diff options
author | Mika Havela <mika.havela@gmail.com> | 2008-01-17 09:44:13 +0000 |
---|---|---|
committer | Mika Havela <mika.havela@gmail.com> | 2008-01-17 09:44:13 +0000 |
commit | 355c7ffbb1504cd06748f126b6ff075f586342b1 (patch) | |
tree | 47a0b688eddaf219613b7f3d94ddc9e8f0be4b0c /lib/getopts.lua | |
parent | 2609a37f65a00d6c487827487293ac4e3e8ce7ea (diff) | |
download | acf-core-355c7ffbb1504cd06748f126b6ff075f586342b1.tar.bz2 acf-core-355c7ffbb1504cd06748f126b6ff075f586342b1.tar.xz |
Fixed a bug when a value contains a - sign. Now it looks for (space)- before splitting up into a variable
git-svn-id: svn://svn.alpinelinux.org/acf/core/trunk@595 ab2d0c66-481e-0410-8bed-d214d4d58bed
Diffstat (limited to 'lib/getopts.lua')
-rw-r--r-- | lib/getopts.lua | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/getopts.lua b/lib/getopts.lua index 45aca7b..84a8fa8 100644 --- a/lib/getopts.lua +++ b/lib/getopts.lua @@ -17,6 +17,9 @@ function getoptsfromfile (file, search, filter) end if (optstable) then opts[a] = optstable + ---[[ Next line is DEBUG info. Should be commented out! + opts[a]["debug"] = b + -- End debug info. --]] else opts[a] = b end @@ -35,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 |