I want to redirect rebol output to C# with -q options but I still get in the end:
REBOL/View 2.7.7.3.1 1-Jan-2010 Copyright 2000-2010 REBOL Technologies. All rights reserved. REBOL is a trademark of REBOL Technologies. WWW.REBOL.COM
Type desktop to start the Viewtop.
C# Source code for context usage:
Process p = new Process();
p.StartInfo.UseShellExecute = false;
p.StartInfo.RedirectStandardOutput = true;
p.StartInfo.WorkingDirectory = @"C:\rebol";
p.StartInfo.FileName = @"C:\rebol\rebol.exe";
p.StartInfo.Arguments = "-qw --do \"firstname: {world} print build-markup {hello <%firstname%>} \"";
p.StartInfo.CreateNoWindow = false;
p.Start();
string output = p.StandardOutput.ReadToEnd();
p.WaitForExit();
MessageBox.Show(output);
If I run rebol directly from Windows I have the same bug:
C:\rebol\rebol.exe -q --do "firstname: {world} print build-markup {hello <%firstname%>}"
will output in rebol console:
hello world
REBOL/View 2.7.7.3.1 1-Jan-2010
Copyright 2000-2010 REBOL Tech开发者_如何学编程nologies. All rights reserved.
REBOL is a trademark of REBOL Technologies. WWW.REBOL.COM
Type desktop to start the Viewtop.
>>
If you use --do
to run script code, you will need to add a quit
(or q
) to the end of this script to have REBOL/View quit. Also, to prevent the Viewtop from starting, add the -v
option. So the following should do the trick:
rebol.exe -qvw --do "print {hello} quit"
The reason is a strange interplay between --do
and other interpreter options. I think this could well be considered a bug, but in any case, it has been this way for quite some time.
精彩评论