We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9282d97 commit 2041bc6Copy full SHA for 2041bc6
2 files changed
tcl/Makefile
@@ -12,6 +12,7 @@ test-spawn:
12
$(TCLSH) test.tcl spawn
13
14
test-pipe:
15
+ $(R2) -qi test.tcl /bin/ls
16
$(R2) -q0 -c '#!pipe $(TCLSH) test.tcl pipe' /bin/ls
17
18
clean:
tcl/test.tcl
@@ -24,9 +24,17 @@ proc test_pipe {} {
24
$r2 close
25
}
26
27
-set mode [expr {$argc > 0 ? [lindex $argv 0] : "spawn"}]
+if {[info exists ::env(R2PIPE_IN)] && [info exists ::env(R2PIPE_OUT)]} {
28
+ set mode pipe
29
+} elseif {[info exists argc] && $argc > 0} {
30
+ set mode [lindex $argv 0]
31
+} else {
32
+ set mode spawn
33
+}
34
+
35
if {$mode eq "pipe"} {
36
test_pipe
37
} else {
38
test_spawn
39
40
+puts [string cat "mode: " $mode " OK"]
0 commit comments