From 454cb1ce1d8a35f712139e0ae5958370d6d56e81 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Mon, 24 Mar 2025 15:16:56 -0400 Subject: Change commands interface so it can either run or get result --- examples/shell/shell.tm | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'examples/shell/shell.tm') diff --git a/examples/shell/shell.tm b/examples/shell/shell.tm index f1e2308d..9ca9e059 100644 --- a/examples/shell/shell.tm +++ b/examples/shell/shell.tm @@ -24,8 +24,11 @@ lang Shell: func command(shell:Shell -> Command): return Command("sh", ["-c", shell.text]) - func run(shell:Shell, input="", input_bytes=[:Byte] -> ProgramResult): - return shell:command():run(input=input, input_bytes=input_bytes) + func result(shell:Shell, input="", input_bytes=[:Byte] -> ProgramResult): + return shell:command():result(input=input, input_bytes=input_bytes) + + func run(shell:Shell -> ExitType): + return shell:command():run() func get_output(shell:Shell, input="", trim_newline=yes -> Text?): return shell:command():get_output(input=input, trim_newline=trim_newline) -- cgit v1.2.3