diff options
author | Philipp Gesang <phg@phi-gamma.net> | 2018-06-27 20:11:20 +0200 |
---|---|---|
committer | Philipp Gesang <phg@phi-gamma.net> | 2018-07-04 08:08:24 +0200 |
commit | dd3a98c473c723919d7a52658f19add97638b858 (patch) | |
tree | 272ef5bdc0c4d065ae86cde7672bb638ec3f17f2 /inout.lua | |
parent | a5266a028f7a9414af3ebc38ec569d3f7503cf51 (diff) | |
download | caldr-dd3a98c473c723919d7a52658f19add97638b858.tar.gz |
cal: process lines into nested representation
Diffstat (limited to 'inout.lua')
-rwxr-xr-x[-rw-r--r--] | inout.lua | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/inout.lua b/inout.lua index ad1c23d..5878c16 100644..100755 --- a/inout.lua +++ b/inout.lua @@ -1,9 +1,16 @@ +#!/usr/bin/env lua local cal = require "cal" local main = function (argv) - local ok = cal.output (cal.parse_stdin ()) + local ok, parsed = cal.parse_stdin () + if not ok then + error ("error parsing input: " .. parsed) + return -1 + end - return ok and 0 or -1 + cal.output (parsed) + + return 0 end os.exit (main ()) |