summaryrefslogtreecommitdiff
path: root/scripts/context/lua
diff options
context:
space:
mode:
authorPhilipp Gesang <gesang@stud.uni-heidelberg.de>2012-06-06 11:58:57 +0200
committerPhilipp Gesang <gesang@stud.uni-heidelberg.de>2012-06-06 11:58:57 +0200
commit691fb4c826067d0ed47420cd44901206216a00ee (patch)
tree474b91c236941fc64e0a7f3c028ff5c994afbb19 /scripts/context/lua
parent74cd9772dbebb7ad43760a72a9d096a3c431a956 (diff)
downloadenigma-691fb4c826067d0ed47420cd44901206216a00ee.tar.gz
group output to five-character chunks
Diffstat (limited to 'scripts/context/lua')
-rw-r--r--scripts/context/lua/third/enigma/mtx-t-enigma.lua12
1 files changed, 10 insertions, 2 deletions
diff --git a/scripts/context/lua/third/enigma/mtx-t-enigma.lua b/scripts/context/lua/third/enigma/mtx-t-enigma.lua
index fb7adbd..818138e 100644
--- a/scripts/context/lua/third/enigma/mtx-t-enigma.lua
+++ b/scripts/context/lua/third/enigma/mtx-t-enigma.lua
@@ -47,9 +47,17 @@ local out = function (str)
io.write(str)
end
+local machine_id = "external"
if setup and text then
- local machine = enigma.new_machine(enigma.parse_args(setup))
- machine.name = "external"
+ local args = enigma.parse_args(setup)
+ if not args then
+ application.help()
+ io.write"\n\n[Error] Could not process enigma setup!\n\n"
+ end
+ enigma.save_raw_args(args, machine_id)
+ --local machine = enigma.new_machine(enigma.parse_args(setup))
+ local machine = enigma.new_machine(machine_id)
+ --machine.name = machine_id
local result = machine:encode_string(text)
if result then
out(result)