From 691fb4c826067d0ed47420cd44901206216a00ee Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Wed, 6 Jun 2012 11:58:57 +0200 Subject: group output to five-character chunks --- scripts/context/lua/third/enigma/mtx-t-enigma.lua | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'scripts') 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) -- cgit v1.2.3