turbo-editors/turbo-golopublic Fork 0
49c12f54ef399972152fccd592ae27e94977f9b5
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.

cli.md · 116 lines · 6.5 KBmarkdown Blame HistoryRaw
📦 Turbo Golo d710c1b k33g yesterday1# Reference: command line
2
3> Neutral description of the `turbo-golo` command, its flags, and the environment it reads.
4
5## Synopsis
6
7```
8turbo-golo [flags] [file...]
9```
10
11Each `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.
12
13## Flags
14
15| Flag | Type | Default | Description |
16| --- | --- | --- | --- |
17| `-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. |
18| `-list-themes` | bool | `false` | Print every loadable theme with its description, then the user theme directory, and exit. |
19| `-no-lsp` | bool | `false` | Do not start a language server. Colouring and editing are unaffected. |
20| `-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). |
📦 Turbo Golo b2b07ec k33g 13h ago21| `-load-config <url>` | string | none | Copy the `.turbo-golo` directory found at a repository URL — rickub, GitHub, GitLab or Codeberg, the URL of the directory as the browser shows it — into the working directory, print what arrived, and exit. Needs `git`. Refuses when `./.turbo-golo` already exists. The editor is not started. |
📦 Turbo Golo d710c1b k33g yesterday22| `-h`, `-help` | bool | `false` | Print the flag list and exit. |
23
24## Environment
25
26| Variable | Read by | Effect |
27| --- | --- | --- |
28| `TURBO_GOLO_DIR` | user files | Directory to keep the user's own files in — themes and snippets — instead of `~/.config/turbo-golo`. |
29| `TURBO_GOLO_THEME_DIR` | theme loading | Directory to read user themes from, instead of `<user dir>/themes`. |
30| `TURBO_GOLO_SNIPPET_DIR` | snippets | Directory to read the user's `snippets.toml` from, instead of `<user dir>`. |
31| `TERM` | tcell | Which terminal description to use. |
32| `PATH` | `golo` lookup | Searched first for `golo`; `/usr/local/bin` is tried after it. No other variable names a directory to look in. |
33
34## Files
35
36| Path | Purpose |
37| --- | --- |
38| `$TURBO_GOLO_THEME_DIR/*.toml` | User themes, when the variable is set. |
39| `./.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 b2b07ec k33g 13h ago40| `./.turbo-golo/` (written) | Created by `-load-config` from a repository's copy, when the project has none yet. |
📦 Turbo Golo d710c1b k33g yesterday41| `./.turbo-golo/snippets.toml` | This project's snippets, read each time the Snippets menu opens. See [snippets](snippets.md). |
42| `./.turbo-golo/tools.toml` | This project's tools, read each time the Golo menu opens. See [Golo tools](golo-tools.md). |
43| `~/.config/turbo-golo/themes/*.toml` | User themes on Linux (`os.UserConfigDir`). |
44| `~/.config/turbo-golo/snippets.toml` | User snippets on Linux. |
45| `~/Library/Application Support/turbo-golo/…` | The same two on macOS. |
46
47There 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.
48
49## Exit status
50
51| Status | Meaning |
52| --- | --- |
53| `0` | The editor exited normally, or an informational flag was used. |
54| `1` | The terminal could not be opened or initialised. The reason is printed to standard error. |
55
56## Make targets
57
58Run from a checkout.
59
60| Target | What it runs |
61| --- | --- |
62| `make help` | List the targets. This is the default. |
63| `make test` | `go test ./...` |
64| `make test-verbose` | `go test -v ./...` |
65| `make cover` | `go test -cover ./...` |
66| `make build` | `go build -ldflags "…" -o bin/turbo-golo .`, stamping the version, then `scripts/check-version.sh` on the result |
67| `make version` | Print the version this checkout would stamp, without building |
68| `make ldflags` | Print the linker flags a stamped build uses |
69| `make install` | `scripts/install.sh` — build and install onto your PATH |
70| `make uninstall` | `scripts/install.sh --uninstall` |
71| `make run FILE=x.golo` | `make build`, then `./bin/turbo-golo x.golo` |
72| `make fmt` | `go fmt ./...` |
73| `make vet` | `go vet ./...` |
74| `make check` | `fmt`, then `vet`, then `test` |
75| `make clean` | Remove `bin/` |
76
77## Examples
78
79```bash
80turbo-golo # one empty window
81turbo-golo main.golo main_test.golo # two windows
82turbo-golo -theme turbo-dark main.golo # a different theme
83turbo-golo -no-lsp main.golo # no language server
84turbo-golo -list-themes # what themes exist
📦 Turbo Golo b2b07ec k33g 13h ago85turbo-golo -load-config https://rickub.com/turbo-editors/configs/tree/main/golang-init # start from a shared configuration
📦 Turbo Golo d710c1b k33g yesterday86```
87
88## Installer
89
90`scripts/install.sh`, also reachable as `make install`.
91
92| Option | Description |
93| --- | --- |
94| `-p`, `--prefix DIR` | Install into `DIR` instead of `$GOBIN` or `$GOPATH/bin`. |
95| `--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. |
96| `--uninstall` | Remove an installed `turbo-golo` and stop. |
97| `-h`, `--help` | Print the options and stop. |
98
99| Exit status | Meaning |
100| --- | --- |
101| `0` | Installed, removed, or help printed. |
102| `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. |
103
104## Errors
105
106| Message | Cause |
107| --- | --- |
108| `turbo-golo: opening the terminal: …` | tcell could not open the terminal; usually `TERM` is unset or unknown. |
109| `turbo-golo: initialising the terminal: …` | The terminal was opened but could not be put into raw mode. |
110| `turbo-golo: reading …/settings.toml: …` | The project's settings file is not valid; the editor opens with its defaults. |
111| `Cannot open` (in a dialog) | The path is a directory, or is not readable. |
112| `Cannot save` (in a dialog) | The directory does not exist, or is not writable. |
📦 Turbo Golo b2b07ec k33g 13h ago113| `turbo-golo: configrepo: the project already has a configuration directory: …` | `-load-config` into a project that already has `.turbo-golo`. Move it away first. |
114| `turbo-golo: configrepo: git is not installed` | `-load-config` needs the `git` command on `PATH`. |
115| `turbo-golo: configrepo: no configuration directory at that path: …` | The repository was found but holds no `.turbo-golo` where the URL points. |
116| `turbo-golo: configrepo: no repository answered: …` | No clone address for that URL answered; the URL, the network, or a private repository. |