SciTE 中的多行 command.go

发布于 2024-10-08 09:23:46 字数 794 浏览 8 评论 0原文

简短内容

这涉及 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 技术交流群。

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

发布评论

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

评论(2

素年丶 2024-10-15 09:23:47

像这样编写一个批处理脚本:

@echo off
if (%1 == "") (goto end)

set gofile=%1%
shift

8g %gofile%.go
8l -o %gofile%.exe %gofile%.8
%gofile%.exe

:end

批处理文件可以位于任何位置,但假设它位于“C:\one\two\third\GO.bat”(不带引号)中。在 SciTE 属性文件中将:更改

command.go.*.go=$(FileName).exe

command.go.*.go=C:\one\two\three\GO.bat $(FileName)

当您按 F5 或单击“Go”时,它将编译、链接并执行该文件。

Write a batch script like so:

@echo off
if (%1 == "") (goto end)

set gofile=%1%
shift

8g %gofile%.go
8l -o %gofile%.exe %gofile%.8
%gofile%.exe

:end

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:

command.go.*.go=$(FileName).exe

to

command.go.*.go=C:\one\two\three\GO.bat $(FileName)

And when you hit F5 or click on "Go", it will compile, link, and execute the file.

心凉 2024-10-15 09:23:47

你有没有空格的行继续转义,这就是它看起来像这样的原因。

我不了解 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.

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