aboutsummaryrefslogtreecommitdiff
path: root/examples/commands/commands.tm
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2025-04-02 16:14:20 -0400
committerBruce Hill <bruce@bruce-hill.com>2025-04-02 16:14:20 -0400
commit6ec8f20fc506af4af5513803fb9a708e4f7b5040 (patch)
tree8b952073f6eda5b85c375a65c73647a85fa16f27 /examples/commands/commands.tm
parentecaf34247eb0728a913804033cf302dada417028 (diff)
Syntax change: table types are now: `{K=V; default=...}` and tables
use `{:K=V, ...; default=...}`
Diffstat (limited to 'examples/commands/commands.tm')
-rw-r--r--examples/commands/commands.tm8
1 files changed, 4 insertions, 4 deletions
diff --git a/examples/commands/commands.tm b/examples/commands/commands.tm
index 26b82790..cbf5439b 100644
--- a/examples/commands/commands.tm
+++ b/examples/commands/commands.tm
@@ -3,8 +3,8 @@
use ./commands.c
use -lunistring
-extern run_command:func(exe:Text, args:[Text], env:{Text,Text}, input:[Byte]?, output:&[Byte]?, error:&[Byte]? -> Int32)
-extern command_by_line:func(exe:Text, args:[Text], env:{Text,Text} -> func(->Text?)?)
+extern run_command:func(exe:Text, args:[Text], env:{Text=Text}, input:[Byte]?, output:&[Byte]?, error:&[Byte]? -> Int32)
+extern command_by_line:func(exe:Text, args:[Text], env:{Text=Text} -> func(->Text?)?)
enum ExitType(Exited(status:Int32), Signaled(signal:Int32), Failed):
func succeeded(e:ExitType -> Bool):
@@ -46,8 +46,8 @@ struct ProgramResult(stdout:[Byte], stderr:[Byte], exit_type:ExitType):
else:
return no
-struct Command(command:Text, args=[:Text], env={:Text,Text}):
- func from_path(path:Path, args=[:Text], env={:Text,Text} -> Command):
+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 result(command:Command, input="", input_bytes=[:Byte] -> ProgramResult):