diff options
| author | s-ol <s-ol@users.noreply.github.com> | 2021-01-08 13:41:37 +0000 |
|---|---|---|
| committer | s-ol <s+removethis@s-ol.nu> | 2025-03-02 14:24:49 +0000 |
| commit | f6cccc5f482f84ea9d5855b853b90359586ac80c (patch) | |
| tree | 1e6bd5e108d3ee822e8559ee5572b6f19a903084 | |
| parent | show meta.description field in module docs (diff) | |
| download | alive-f6cccc5f482f84ea9d5855b853b90359586ac80c.tar.gz alive-f6cccc5f482f84ea9d5855b853b90359586ac80c.zip | |
copilot/cli: colorize output linewise
| -rw-r--r-- | alv/copilot/cli.moon | 9 |
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 } |
