aboutsummaryrefslogtreecommitdiff
path: root/environment.c
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2024-09-16 17:02:20 -0400
committerBruce Hill <bruce@bruce-hill.com>2024-09-16 17:02:20 -0400
commit9703ca45f0472dfed440f373c29206b0b2c8e4db (patch)
tree0ea5f11d0bd59f2b7d36623a6e510c460317feac /environment.c
parent32c139e1f468864ce23bc091d9db309b1206c872 (diff)
Update Shell API to have byte-based mode and by_line() just like files
Diffstat (limited to 'environment.c')
-rw-r--r--environment.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/environment.c b/environment.c
index 228c5ac4..8ae4611c 100644
--- a/environment.c
+++ b/environment.c
@@ -300,9 +300,11 @@ env_t *new_compilation_unit(CORD *libname)
{"starts_with", "Text$starts_with", "func(path:Path, prefix:Text)->Bool"},
)},
{"Shell", Type(TextType, .lang="Shell", .env=namespace_env(env, "Shell")), "Shell_t", "Shell$info", TypedArray(ns_entry_t,
+ {"by_line", "Shell$by_line", "func(command:Shell)->(func()->Text?)?"},
{"escape_int", "Int$value_as_text", "func(i:Int)->Shell"},
{"escape_text", "Shell$escape_text", "func(text:Text)->Shell"},
- {"run", "Shell$run", "func(command:Shell, status=!&Int32)->Text"},
+ {"run_bytes", "Shell$run", "func(command:Shell)->[Byte]?"},
+ {"run", "Shell$run", "func(command:Shell)->Text?"},
)},
{"Text", TEXT_TYPE, "Text_t", "Text$info", TypedArray(ns_entry_t,
{"as_c_string", "Text$as_c_string", "func(text:Text)->CString"},