summaryrefslogtreecommitdiff
path: root/fromdb.lua
diff options
context:
space:
mode:
authorPhilipp Gesang <phg@phi-gamma.net>2018-09-09 00:38:24 +0200
committerPhilipp Gesang <phg@phi-gamma.net>2018-09-09 00:38:24 +0200
commitfe2fbd04eca6779dddfce6dbbc565e050a05ff1f (patch)
tree68ebeee02d0d08eda1854d162c999f96776610a2 /fromdb.lua
parent1d7af97d4cb261d5a0b82f6f0ccf7e788ff5a54a (diff)
downloadcaldr-fe2fbd04eca6779dddfce6dbbc565e050a05ff1f.tar.gz
db: add trivial json db reader
Diffstat (limited to 'fromdb.lua')
-rwxr-xr-xfromdb.lua24
1 files changed, 24 insertions, 0 deletions
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 ())
+