From 1aaa67daf4db00bb3a6e494c40b2fbe375ec4f56 Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Sat, 8 Sep 2018 23:52:19 +0200 Subject: db: add json writer functionality This introduces a dependency on the cjson library. --- todb.lua | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100755 todb.lua (limited to 'todb.lua') diff --git a/todb.lua b/todb.lua new file mode 100755 index 0000000..50799ec --- /dev/null +++ b/todb.lua @@ -0,0 +1,20 @@ +#!/usr/bin/env lua +local cal = require "cal" +local db = require "db" +local common = require "common" + +common.set_verbosity (1) + +local main = function (argv) + local ok, parsed = cal.parse_stdin () + if not ok then + return -1 + end + + local ok = db.output_calendar (parsed) + + return ok and 0 or -1 +end + +os.exit (main ()) + -- cgit v1.2.3