From fe2fbd04eca6779dddfce6dbbc565e050a05ff1f Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Sun, 9 Sep 2018 00:38:24 +0200 Subject: db: add trivial json db reader --- fromdb.lua | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100755 fromdb.lua (limited to 'fromdb.lua') diff --git a/fromdb.lua b/fromdb.lua new file mode 100755 index 0000000..cd17406 --- /dev/null +++ b/fromdb.lua @@ -0,0 +1,24 @@ +#!/usr/bin/env lua +local rem = require "rem" +local db = require "db" +local common = require "common" + +local status = common.status +local status_ok = status.codes.ok +local status_error = status.codes.error + +common.set_verbosity (1) + +local main = function (argv) + local st, parsed = db.read_json_db () + if st ~= status_ok then + return -1 + end + + local st = rem.output_calendar (parsed) + + return st == status_ok and 0 or -1 +end + +os.exit (main ()) + -- cgit v1.2.3