diff options
author | Philipp Gesang <phg@phi-gamma.net> | 2018-09-09 00:38:24 +0200 |
---|---|---|
committer | Philipp Gesang <phg@phi-gamma.net> | 2018-09-09 00:38:24 +0200 |
commit | fe2fbd04eca6779dddfce6dbbc565e050a05ff1f (patch) | |
tree | 68ebeee02d0d08eda1854d162c999f96776610a2 /fromdb.lua | |
parent | 1d7af97d4cb261d5a0b82f6f0ccf7e788ff5a54a (diff) | |
download | caldr-fe2fbd04eca6779dddfce6dbbc565e050a05ff1f.tar.gz |
db: add trivial json db reader
Diffstat (limited to 'fromdb.lua')
-rwxr-xr-x | fromdb.lua | 24 |
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 ()) + |