SciTE 中的多行 command.go
简短内容
这涉及 SciTE 和 Windows(特别是 Windows 7)中的 go 语言。这是我第一次使用 SciTE,所以如果有其他方法来实现我的目标也很好。
目标:一键编译、链接并执行新创建的二进制文件。
。
我想在 SciTE 中的“go”命令下设置编译/链接/执行 这可能有点令人困惑,因为它也适用于 go 语言。这是我到目前为止所拥有的:
command.compile.*.go=8g $(FileNameExt)
command.build.*.go=8l -o $(FileName).exe $(FileName).8
command.go.*.go=$(FileName).exe
我想要的是这样的东西:
command.go.*.go=\
8g $(FileNamExt)\
8l -o $(FileName).exe $(FileName).8\
$(FileName).exe
如果这按照我预期的方式工作,它将编译文件,链接它,然后运行可执行文件。发生的情况是:
8g hello.go8l -o hello.exe hello.8hello.exe
何时:
8g hello.go
8l -o hello.exe hello.8
hello.exe
执行每行的位置。
The Short
This deals with SciTE and the go language in Windows (in particular, Windows 7). This is my first time using SciTE, so if there is another way to achieve my goal that is fine as well.
Goal: With one key press, compile, link, and execute the newly created binary.
The Long
I want to setup the compile/link/excecute under the "go" command in SciTE. This may be slightly confusing as it is also for the go language. Here is what I have so far:
command.compile.*.go=8g $(FileNameExt)
command.build.*.go=8l -o $(FileName).exe $(FileName).8
command.go.*.go=$(FileName).exe
What I would like is to have something like:
command.go.*.go=\
8g $(FileNamExt)\
8l -o $(FileName).exe $(FileName).8\
$(FileName).exe
If this worked the way I intended it would compile the file, link it, and then run the executable. What happens is:
8g hello.go8l -o hello.exe hello.8hello.exe
When it should be:
8g hello.go
8l -o hello.exe hello.8
hello.exe
Where each line is executed.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
像这样编写一个批处理脚本:
批处理文件可以位于任何位置,但假设它位于“C:\one\two\third\GO.bat”(不带引号)中。在 SciTE 属性文件中将:更改
为
当您按 F5 或单击“Go”时,它将编译、链接并执行该文件。
Write a batch script like so:
The batch file can be anywhere, but let's say it's in 'C:\one\two\three\GO.bat' sans the quotes. In the SciTE property file change:
to
And when you hit F5 or click on "Go", it will compile, link, and execute the file.
你有没有空格的行继续转义,这就是它看起来像这样的原因。
我不了解 Windows,但在 unix shell 中,您可以用分号分隔多个命令(或者像 peterSO 提到的
&&
,这在这里更合适)。您仍然可以换行,但要意识到它不会考虑换行在语法上的重要性,因此请适当添加分隔字符。
You have line continuation escapes with no spaces which is why it looks like that.
I don't know Windows, but in unix shells you can separate multiple commands with semicolons (or
&&
as peterSO mentions, which is more appropriate here).You can still wrap, but realize that it's not going to consider the wrapping syntactically significant due, so add separation characters as appropriate.