summaryrefslogtreecommitdiff
path: root/inout.lua
diff options
context:
space:
mode:
authorPhilipp Gesang <phg@phi-gamma.net>2018-06-27 20:11:20 +0200
committerPhilipp Gesang <phg@phi-gamma.net>2018-07-04 08:08:24 +0200
commitdd3a98c473c723919d7a52658f19add97638b858 (patch)
tree272ef5bdc0c4d065ae86cde7672bb638ec3f17f2 /inout.lua
parenta5266a028f7a9414af3ebc38ec569d3f7503cf51 (diff)
downloadcaldr-dd3a98c473c723919d7a52658f19add97638b858.tar.gz
cal: process lines into nested representation
Diffstat (limited to 'inout.lua')
-rwxr-xr-x[-rw-r--r--]inout.lua11
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 ())