summaryrefslogtreecommitdiff
path: root/inout.lua
diff options
context:
space:
mode:
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 ())