turbo-editors/turbo-golopublic Fork 0
v1.0.2
Commits
Clone
git clone https://git.rickub.com/turbo-editors/turbo-golo.git
git clone ssh://git@rickub.com/turbo-editors/turbo-golo.git

Host key fingerprint (ed25519): SHA256:iycHnxEyq0Q7uyVpB7JlznP0G7JrTPXLYRcAU5CSLhc — verify it before your first connect.

📦 Turbo Golo d710c1b · on v1.0.2 · k33g · 11h ago
cli.md · 109 lines · 5.4 KBmarkdown
Blame HistoryOpen raw

Reference: command line

Neutral description of the turbo-golo command, its flags, and the environment it reads.

Synopsis

turbo-golo [flags] [file...]

Each file is opened in its own window. A file that does not exist yet is opened as an empty buffer bound to that path. With no file at all, one empty untitled window is opened.

Flags

Flag Type Default Description
-theme <name> string the project's, else turbo-classic Theme to start with, overriding the project's own. An unknown name falls back to the default without an error.
-list-themes bool false Print every loadable theme with its description, then the user theme directory, and exit.
-no-lsp bool false Do not start a language server. Colouring and editing are unaffected.
-version bool false Print Turbo Golo <version> on one line, with the commit and build date when the build recorded them, and exit. See the version number.
-h, -help bool false Print the flag list and exit.

Environment

Variable Read by Effect
TURBO_GOLO_DIR user files Directory to keep the user's own files in — themes and snippets — instead of ~/.config/turbo-golo.
TURBO_GOLO_THEME_DIR theme loading Directory to read user themes from, instead of <user dir>/themes.
TURBO_GOLO_SNIPPET_DIR snippets Directory to read the user's snippets.toml from, instead of <user dir>.
TERM tcell Which terminal description to use.
PATH golo lookup Searched first for golo; /usr/local/bin is tried after it. No other variable names a directory to look in.

Files

Path Purpose
$TURBO_GOLO_THEME_DIR/*.toml User themes, when the variable is set.
./.turbo-golo/settings.toml This project's settings, read at start-up and again when saved from the editor. See project settings.
./.turbo-golo/snippets.toml This project's snippets, read each time the Snippets menu opens. See snippets.
./.turbo-golo/tools.toml This project's tools, read each time the Golo menu opens. See Golo tools.
~/.config/turbo-golo/themes/*.toml User themes on Linux (os.UserConfigDir).
~/.config/turbo-golo/snippets.toml User snippets on Linux.
~/Library/Application Support/turbo-golo/… The same two on macOS.

There is no project marker file. The language server is started in the directory of the first file named on the command line, or in the working directory when none is; no parent directory is looked at.

Exit status

Status Meaning
0 The editor exited normally, or an informational flag was used.
1 The terminal could not be opened or initialised. The reason is printed to standard error.

Make targets

Run from a checkout.

Target What it runs
make help List the targets. This is the default.
make test go test ./...
make test-verbose go test -v ./...
make cover go test -cover ./...
make build go build -ldflags "…" -o bin/turbo-golo ., stamping the version, then scripts/check-version.sh on the result
make version Print the version this checkout would stamp, without building
make ldflags Print the linker flags a stamped build uses
make install scripts/install.sh — build and install onto your PATH
make uninstall scripts/install.sh --uninstall
make run FILE=x.golo make build, then ./bin/turbo-golo x.golo
make fmt go fmt ./...
make vet go vet ./...
make check fmt, then vet, then test
make clean Remove bin/

Examples

turbo-golo                                    # one empty window
turbo-golo main.golo main_test.golo           # two windows
turbo-golo -theme turbo-dark main.golo        # a different theme
turbo-golo -no-lsp main.golo                  # no language server
turbo-golo -list-themes                       # what themes exist

Installer

scripts/install.sh, also reachable as make install.

Option Description
-p, --prefix DIR Install into DIR instead of $GOBIN or $GOPATH/bin.
--with-server Also build and install GoloScript — golo, gogolo and wagolo — from source into /usr/local/bin, if golo is not already there. Needs git and Go.
--uninstall Remove an installed turbo-golo and stop.
-h, --help Print the options and stop.
Exit status Meaning
0 Installed, removed, or help printed.
1 Go missing or too old, the build failed, the built binary did not report its version, or the destination could not be written. Nothing is installed and an existing installation is left untouched.

Errors

Message Cause
turbo-golo: opening the terminal: … tcell could not open the terminal; usually TERM is unset or unknown.
turbo-golo: initialising the terminal: … The terminal was opened but could not be put into raw mode.
turbo-golo: reading …/settings.toml: … The project's settings file is not valid; the editor opens with its defaults.
Cannot open (in a dialog) The path is a directory, or is not readable.
Cannot save (in a dialog) The directory does not exist, or is not writable.
  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
# Reference: command line

> Neutral description of the `turbo-golo` command, its flags, and the environment it reads.

## Synopsis

```
turbo-golo [flags] [file...]
```

Each `file` is opened in its own window. A file that does not exist yet is opened as an empty buffer bound to that path. With no file at all, one empty untitled window is opened.

## Flags

| Flag | Type | Default | Description |
| --- | --- | --- | --- |
| `-theme <name>` | string | the project's, else `turbo-classic` | Theme to start with, overriding the project's own. An unknown name falls back to the default without an error. |
| `-list-themes` | bool | `false` | Print every loadable theme with its description, then the user theme directory, and exit. |
| `-no-lsp` | bool | `false` | Do not start a language server. Colouring and editing are unaffected. |
| `-version` | bool | `false` | Print `Turbo Golo <version>` on one line, with the commit and build date when the build recorded them, and exit. See [the version number](versioning.md). |
| `-h`, `-help` | bool | `false` | Print the flag list and exit. |

## Environment

| Variable | Read by | Effect |
| --- | --- | --- |
| `TURBO_GOLO_DIR` | user files | Directory to keep the user's own files in — themes and snippets — instead of `~/.config/turbo-golo`. |
| `TURBO_GOLO_THEME_DIR` | theme loading | Directory to read user themes from, instead of `<user dir>/themes`. |
| `TURBO_GOLO_SNIPPET_DIR` | snippets | Directory to read the user's `snippets.toml` from, instead of `<user dir>`. |
| `TERM` | tcell | Which terminal description to use. |
| `PATH` | `golo` lookup | Searched first for `golo`; `/usr/local/bin` is tried after it. No other variable names a directory to look in. |

## Files

| Path | Purpose |
| --- | --- |
| `$TURBO_GOLO_THEME_DIR/*.toml` | User themes, when the variable is set. |
| `./.turbo-golo/settings.toml` | This project's settings, read at start-up and again when saved from the editor. See [project settings](project-settings.md). |
| `./.turbo-golo/snippets.toml` | This project's snippets, read each time the Snippets menu opens. See [snippets](snippets.md). |
| `./.turbo-golo/tools.toml` | This project's tools, read each time the Golo menu opens. See [Golo tools](golo-tools.md). |
| `~/.config/turbo-golo/themes/*.toml` | User themes on Linux (`os.UserConfigDir`). |
| `~/.config/turbo-golo/snippets.toml` | User snippets on Linux. |
| `~/Library/Application Support/turbo-golo/…` | The same two on macOS. |

There is no project marker file. The language server is started in the directory of the first file named on the command line, or in the working directory when none is; no parent directory is looked at.

## Exit status

| Status | Meaning |
| --- | --- |
| `0` | The editor exited normally, or an informational flag was used. |
| `1` | The terminal could not be opened or initialised. The reason is printed to standard error. |

## Make targets

Run from a checkout.

| Target | What it runs |
| --- | --- |
| `make help` | List the targets. This is the default. |
| `make test` | `go test ./...` |
| `make test-verbose` | `go test -v ./...` |
| `make cover` | `go test -cover ./...` |
| `make build` | `go build -ldflags "…" -o bin/turbo-golo .`, stamping the version, then `scripts/check-version.sh` on the result |
| `make version` | Print the version this checkout would stamp, without building |
| `make ldflags` | Print the linker flags a stamped build uses |
| `make install` | `scripts/install.sh` — build and install onto your PATH |
| `make uninstall` | `scripts/install.sh --uninstall` |
| `make run FILE=x.golo` | `make build`, then `./bin/turbo-golo x.golo` |
| `make fmt` | `go fmt ./...` |
| `make vet` | `go vet ./...` |
| `make check` | `fmt`, then `vet`, then `test` |
| `make clean` | Remove `bin/` |

## Examples

```bash
turbo-golo                                    # one empty window
turbo-golo main.golo main_test.golo           # two windows
turbo-golo -theme turbo-dark main.golo        # a different theme
turbo-golo -no-lsp main.golo                  # no language server
turbo-golo -list-themes                       # what themes exist
```

## Installer

`scripts/install.sh`, also reachable as `make install`.

| Option | Description |
| --- | --- |
| `-p`, `--prefix DIR` | Install into `DIR` instead of `$GOBIN` or `$GOPATH/bin`. |
| `--with-server` | Also build and install GoloScript — `golo`, `gogolo` and `wagolo` — from source into `/usr/local/bin`, if `golo` is not already there. Needs `git` and Go. |
| `--uninstall` | Remove an installed `turbo-golo` and stop. |
| `-h`, `--help` | Print the options and stop. |

| Exit status | Meaning |
| --- | --- |
| `0` | Installed, removed, or help printed. |
| `1` | Go missing or too old, the build failed, the built binary did not report its version, or the destination could not be written. Nothing is installed and an existing installation is left untouched. |

## Errors

| Message | Cause |
| --- | --- |
| `turbo-golo: opening the terminal: …` | tcell could not open the terminal; usually `TERM` is unset or unknown. |
| `turbo-golo: initialising the terminal: …` | The terminal was opened but could not be put into raw mode. |
| `turbo-golo: reading …/settings.toml: …` | The project's settings file is not valid; the editor opens with its defaults. |
| `Cannot open` (in a dialog) | The path is a directory, or is not readable. |
| `Cannot save` (in a dialog) | The directory does not exist, or is not writable. |