From f3b8529e01f66f4743d26a62237706a09a2f1f71 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Wed, 19 Mar 2025 16:17:44 -0400 Subject: Add command and shell :by_line() --- examples/shell/shell.tm | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'examples/shell/shell.tm') diff --git a/examples/shell/shell.tm b/examples/shell/shell.tm index cf5fcd2e..f1e2308d 100644 --- a/examples/shell/shell.tm +++ b/examples/shell/shell.tm @@ -33,3 +33,9 @@ lang Shell: func get_output_bytes(shell:Shell, input="", input_bytes=[:Byte] -> [Byte]?): return shell:command():get_output_bytes(input=input, input_bytes=input_bytes) + func by_line(shell:Shell -> func(->Text?)?): + return shell:command():by_line() + +func main(command:Shell): + for line in command:by_line()!: + >> line -- cgit v1.2.3