aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--examples/commands/commands.tm3
1 files changed, 3 insertions, 0 deletions
diff --git a/examples/commands/commands.tm b/examples/commands/commands.tm
index 940dc3d9..a0e73908 100644
--- a/examples/commands/commands.tm
+++ b/examples/commands/commands.tm
@@ -32,6 +32,9 @@ struct ProgramResult(stdout:[Byte], stderr:[Byte], exit_type:ExitType):
return none
struct Command(command:Text, args=[:Text], env={:Text,Text}):
+ func from_path(path:Path, args=[:Text], env={:Text,Text} -> Command):
+ return Command(Text(path), args, env)
+
func run(command:Command, input="", input_bytes=[:Byte] -> ProgramResult):
if input.length > 0:
(&input_bytes):insert_all(input:bytes())