aboutsummaryrefslogtreecommitdiff
path: root/examples/shell/shell.tm
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2025-03-24 15:16:56 -0400
committerBruce Hill <bruce@bruce-hill.com>2025-03-24 15:16:56 -0400
commit454cb1ce1d8a35f712139e0ae5958370d6d56e81 (patch)
tree3d054d143299a84481dd2da580b4928c334e2779 /examples/shell/shell.tm
parent31af868b5d5825b3179ae8cdb85554f993e20344 (diff)
Change commands interface so it can either run or get result
Diffstat (limited to 'examples/shell/shell.tm')
-rw-r--r--examples/shell/shell.tm7
1 files changed, 5 insertions, 2 deletions
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)