turbo-editors/turbo-rustpublic Fork 0
9c61a674ab7f948adf4959b95f57dc1ac5915d4d
Commits
Clone
git clone https://git.rickub.com/turbo-editors/turbo-rust.git
git clone ssh://git@rickub.com/turbo-editors/turbo-rust.git

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

cli.md · 107 lines · 5.3 KBmarkdown Blame HistoryRaw
📦 Turbo Rust 713ea5c k33g yesterday1# Reference: command line
2
3> Neutral description of the `turbo-rust` command, its flags, and the environment it reads.
4
5## Synopsis
6
7```
8turbo-rust [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 Rust <version>` on one line, with the commit and build date when the build recorded them, and exit. See [the version number](versioning.md). |
📦 Turbo Rust f69efbe k33g 10h ago21| `-load-config <url>` | string | none | Copy the `.turbo-rust` 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-rust` already exists. The editor is not started. |
📦 Turbo Rust 713ea5c k33g yesterday22| `-h`, `-help` | bool | `false` | Print the flag list and exit. |
23
24## Environment
25
26| Variable | Read by | Effect |
27| --- | --- | --- |
28| `TURBO_RUST_THEME_DIR` | theme loading | Directory to read user themes from, instead of the platform configuration directory. |
29| `TERM` | tcell | Which terminal description to use. |
30| `GOBIN`, `GOPATH`, `HOME` | rust-analyzer lookup | Searched, in that order, when `rust-analyzer` is not on `PATH`. |
31
32## Files
33
34| Path | Purpose |
35| --- | --- |
36| `$TURBO_RUST_THEME_DIR/*.toml` | User themes, when the variable is set. |
37| `./.turbo-rust/settings.toml` | This project's settings, read once at start-up. See [project settings](project-settings.md). |
📦 Turbo Rust f69efbe k33g 10h ago38| `./.turbo-rust/` (written) | Created by `-load-config` from a repository's copy, when the project has none yet. |
📦 Turbo Rust 713ea5c k33g yesterday39| `~/.config/turbo-rust/themes/*.toml` | User themes on Linux (`os.UserConfigDir`). |
40| `~/Library/Application Support/turbo-rust/themes/*.toml` | User themes on macOS. |
41| `<module>/Cargo.toml` | Located by walking up from the first file; its directory becomes the language server's root. |
42
43## Exit status
44
45| Status | Meaning |
46| --- | --- |
47| `0` | The editor exited normally, or an informational flag was used. |
48| `1` | The terminal could not be opened or initialised. The reason is printed to standard error. |
49
50## Make targets
51
52Run from a checkout.
53
54| Target | What it runs |
55| --- | --- |
56| `make help` | List the targets. This is the default. |
57| `make test` | `cargo test` |
58| `make test-verbose` | `go test -v ./...` |
59| `make cover` | `go test -cover ./...` |
60| `make build` | `go build -o bin/turbo-rust .` |
61| `make install` | `scripts/install.sh` — build and install onto your PATH |
62| `make uninstall` | `scripts/install.sh --uninstall` |
63| `make run FILE=x.go` | `make build`, then `./bin/turbo-rust x.go` |
64| `make fmt` | `go fmt ./...` |
65| `make vet` | `cargo clippy --all-targets` |
66| `make check` | `fmt`, then `vet`, then `test` |
67| `make clean` | Remove `bin/` |
68
69## Examples
70
71```bash
72turbo-rust # one empty window
73turbo-rust main.rs Cargo.toml # two windows
74turbo-rust -theme turbo-dark main.rs # a different theme
75turbo-rust -no-lsp main.rs # no language server
76turbo-rust -list-themes # what themes exist
📦 Turbo Rust f69efbe k33g 10h ago77turbo-rust -load-config https://rickub.com/turbo-editors/configs/tree/main/golang-init # start from a shared configuration
📦 Turbo Rust 713ea5c k33g yesterday78```
79
80## Installer
81
82`scripts/install.sh`, also reachable as `make install`.
83
84| Option | Description |
85| --- | --- |
86| `-p`, `--prefix DIR` | Install into `DIR` instead of `$GOBIN` or `$GOPATH/bin`. |
87| `--with-rust-analyzer` | Install `rust-analyzer` as well, if it is not already there. |
88| `--uninstall` | Remove an installed `turbo-rust` and stop. |
89| `-h`, `--help` | Print the options and stop. |
90
91| Exit status | Meaning |
92| --- | --- |
93| `0` | Installed, removed, or help printed. |
94| `1` | Go missing or too old, the build failed, or the destination could not be written. Nothing is installed and an existing installation is left untouched. |
95
96## Errors
97
98| Message | Cause |
99| --- | --- |
100| `turbo-rust: opening the terminal: …` | tcell could not open the terminal; usually `TERM` is unset or unknown. |
101| `turbo-rust: initialising the terminal: …` | The terminal was opened but could not be put into raw mode. |
102| `Cannot open` (in a dialog) | The path is a directory, or is not readable. |
103| `Cannot save` (in a dialog) | The directory does not exist, or is not writable. |
📦 Turbo Rust f69efbe k33g 10h ago104| `turbo-rust: configrepo: the project already has a configuration directory: …` | `-load-config` into a project that already has `.turbo-rust`. Move it away first. |
105| `turbo-rust: configrepo: git is not installed` | `-load-config` needs the `git` command on `PATH`. |
106| `turbo-rust: configrepo: no configuration directory at that path: …` | The repository was found but holds no `.turbo-rust` where the URL points. |
107| `turbo-rust: configrepo: no repository answered: …` | No clone address for that URL answered; the URL, the network, or a private repository. |