# HG changeset patch # User Mikael Berthe # Date 1319371839 -7200 # Node ID a7c6c2b3454b06b32c17aa8cb947e777a80dbf16 # Parent 7f235c928661d38af1ba30c2ae2a2f13be3e3f79 littre: allow some more chars: space and ', - diff -r 7f235c928661 -r a7c6c2b3454b mcbot/cmds/littre.lua --- a/mcbot/cmds/littre.lua Sun Oct 23 13:55:54 2011 +0200 +++ b/mcbot/cmds/littre.lua Sun Oct 23 14:10:39 2011 +0200 @@ -4,10 +4,10 @@ function littre.cmd (args) if not args then return nil, "Give me a word, please" end -- Be careful as we pass it as an argument to a shell command - local word = string.match(args, "^([%wàäâéèëêïîöôùüûç]+)[%s%?%.%!]*$") + local word = string.match(args, "^([%wàäâéèëêïîöôùüûç' -]+)[%s%?%.%!]*$") if not word then return nil, "Can you repeat please?" end - local cmd = "/usr/bin/sdcv "..word.." 2> /dev/null" + local cmd = '/usr/bin/sdcv --non-interactive -- "'..word..'" 2> /dev/null' local fh = io.popen(cmd) result = fh:read("*a") -- read littre output fh:close()