Rebol -q 选项有问题吗?

发布于 2024-10-08 17:46:55 字数 1136 浏览 0 评论 0原文

我想使用 -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.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 Technologies.  All rights reserved.
REBOL is a trademark of REBOL Technologies. WWW.REBOL.COM


Type desktop to start the Viewtop.
>>

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

下壹個目標 2024-10-15 17:46:55

如果您使用 --do 运行脚本代码,则需要在此脚本末尾添加 quit (或 q)退出 REBOL/View。另外,要防止 Viewtop 启动,请添加 -v 选项。因此,以下应该可以解决问题:

rebol.exe -qvw --do "print {hello} quit"

原因是 --do 和其他解释器选项之间的奇怪相互作用。我认为这很可能被视为一个错误,但无论如何,这种情况已经有一段时间了。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文