diff options
Diffstat (limited to 'examples/shell')
| -rw-r--r-- | examples/shell/shell.tm | 6 |
1 files changed, 6 insertions, 0 deletions
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 |
