aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authors-ol <s-ol@users.noreply.github.com>2021-01-08 13:41:37 +0000
committers-ol <s+removethis@s-ol.nu>2025-03-02 14:24:49 +0000
commitf6cccc5f482f84ea9d5855b853b90359586ac80c (patch)
tree1e6bd5e108d3ee822e8559ee5572b6f19a903084
parentshow meta.description field in module docs (diff)
downloadalive-f6cccc5f482f84ea9d5855b853b90359586ac80c.tar.gz
alive-f6cccc5f482f84ea9d5855b853b90359586ac80c.zip
copilot/cli: colorize output linewise
-rw-r--r--alv/copilot/cli.moon9
1 files changed, 8 insertions, 1 deletions
diff --git a/alv/copilot/cli.moon b/alv/copilot/cli.moon
index e4e633a..14bfd6b 100644
--- a/alv/copilot/cli.moon
+++ b/alv/copilot/cli.moon
@@ -7,12 +7,19 @@ import parse_args, Copilot from require 'alv.copilot.base'
import sleep from require 'system'
class ColorLogger extends Logger
+ new: (...) =>
+ super ...
+ @time_pref = ''
+
set_time: (time) =>
super time
- @stream\write switch time
+ @time_pref = switch time
when 'eval' then '\27[92m'
when 'run' then '\27[0m'
+ put: (msg) =>
+ super @time_pref .. msg
+
class CLICopilot extends Copilot
new: (arg) =>
super parse_args arg, { nocolor: false, 'udp-server': false }