Rebol -q 选项有问题吗?
我想使用 -q 选项将 rebol 输出重定向到 C#,但最后我仍然得到:
REBOL/查看 2.7.7.3.1 2010 年 1 月 1 日 版权所有 2000-2010 REBOL 技术。版权所有。 REBOL 是 REBOL 的商标 技术。 WWW.REBOL.COM
键入桌面以启动 Viewtop。
用于上下文使用的 C# 源代码:
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);
如果我直接从 Windows 运行 rebol,我会遇到相同的错误:
C:\rebol\rebol.exe -q --do "名字: {world} 打印构建标记 {hello <%firstname%>}"
将在 rebol 控制台中输出:
hello world
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.
>>
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.COMType 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 Technologies. All rights reserved.
REBOL is a trademark of REBOL Technologies. WWW.REBOL.COM
Type desktop to start the Viewtop.
>>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您使用
--do
运行脚本代码,则需要在此脚本末尾添加quit
(或q
)退出 REBOL/View。另外,要防止 Viewtop 启动,请添加-v
选项。因此,以下应该可以解决问题:原因是
--do
和其他解释器选项之间的奇怪相互作用。我认为这很可能被视为一个错误,但无论如何,这种情况已经有一段时间了。If you use
--do
to run script code, you will need to add aquit
(orq
) 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: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.