absurdor

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit a15830d2c21c143ecfea29c51174a1d14a066d9c
parent 475db927cccb827be80ec0ab4696c5cfe51a5b9a
Author: Juan F. Meleiro <juan@juanmeleiro.mat.br>
Date:   Tue,  5 Sep 2023 09:50:35 -0300

script: Flush stdout so that prompt appears

Diffstat:
Mabsurdor | 17+++++++++--------
1 file changed, 9 insertions(+), 8 deletions(-)

diff --git a/absurdor b/absurdor @@ -23,6 +23,7 @@ function yn(prompt) meaning = {Y = true, y = true, n = false, N = false} while meaning[ans] == nil do io.write(prompt) + io.flush() ans = io.read(1) end return ans @@ -84,6 +85,14 @@ function fmt_event(e) return format(fmt, args) end +function sec2week(s) + return math.floor(s/(24 * 60 * 60 * 7)) +end + +function week2sec(w) + return w*24*60*60*7 +end + local parser = argparse("absurdor", "Manage Absurdor duties") :command_target("command") parser:command("report", "Generate and send absurdor report") @@ -101,14 +110,6 @@ local args = parser:parse() fn = "log.json" log = decodewith(json.decode, fn) -function sec2week(s) - return math.floor(s/(24 * 60 * 60 * 7)) -end - -function week2sec(w) - return w*24*60*60*7 -end - if args.command == "report" then height = 0