diff options
Diffstat (limited to 'stdlib/source/library/lux/world/shell.lux')
-rw-r--r-- | stdlib/source/library/lux/world/shell.lux | 68 |
1 files changed, 36 insertions, 32 deletions
diff --git a/stdlib/source/library/lux/world/shell.lux b/stdlib/source/library/lux/world/shell.lux index 470ac4cd2..d473f7cdb 100644 --- a/stdlib/source/library/lux/world/shell.lux +++ b/stdlib/source/library/lux/world/shell.lux @@ -45,17 +45,18 @@ [+1 error] ) -(interface: .public (Process !) - (: (-> [] (! (Try Text))) - read) - (: (-> [] (! (Try Text))) - error) - (: (-> Text (! (Try Any))) - write) - (: (-> [] (! (Try Any))) - destroy) - (: (-> [] (! (Try Exit))) - await)) +(type: .public (Process !) + (Interface + (: (-> [] (! (Try Text))) + read) + (: (-> [] (! (Try Text))) + error) + (: (-> Text (! (Try Any))) + write) + (: (-> [] (! (Try Any))) + destroy) + (: (-> [] (! (Try Exit))) + await))) (def: (async_process process) (-> (Process IO) (Process Async)) @@ -78,9 +79,10 @@ (type: .public Argument Text) -(interface: .public (Shell !) - (: (-> [Environment Path Command (List Argument)] (! (Try (Process !)))) - execute)) +(type: .public (Shell !) + (Interface + (: (-> [Environment Path Command (List Argument)] (! (Try (Process !)))) + execute))) (def: .public (async shell) (-> (Shell IO) (Shell Async)) @@ -92,13 +94,14 @@ (in (..async_process process))))))) ... https://en.wikipedia.org/wiki/Code_injection#Shell_injection -(interface: (Policy ?) - (: (-> Command (Safe Command ?)) - command) - (: (-> Argument (Safe Argument ?)) - argument) - (: (All [a] (-> (Safe a ?) a)) - value)) +(type: (Policy ?) + (Interface + (: (-> Command (Safe Command ?)) + command) + (: (-> Argument (Safe Argument ?)) + argument) + (: (All [a] (-> (Safe a ?) a)) + value))) (type: (Sanitizer a) (-> a a)) @@ -307,17 +310,18 @@ @.jvm (as_is <jvm>)} (as_is))) -(interface: .public (Mock s) - (: (-> s (Try [s Text])) - on_read) - (: (-> s (Try [s Text])) - on_error) - (: (-> Text s (Try s)) - on_write) - (: (-> s (Try s)) - on_destroy) - (: (-> s (Try [s Exit])) - on_await)) +(type: .public (Mock s) + (Interface + (: (-> s (Try [s Text])) + on_read) + (: (-> s (Try [s Text])) + on_error) + (: (-> Text s (Try s)) + on_write) + (: (-> s (Try s)) + on_destroy) + (: (-> s (Try [s Exit])) + on_await))) (`` (implementation: (mock_process state mock) (All [s] (-> (Atom s) (Mock s) (Process IO))) |