Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c65835f02a | ||
|
|
07c89f4939 |
No files matched your search
@@ -28,21 +28,24 @@ dependencies.
|
||||
| `talk test` | speak a test sentence; shows provider and timings (`--lang`, `--provider`, `--voice`); `--toast` sends a test notification instead |
|
||||
| `talk doctor` | self-diagnosis: config, daemon, audio, providers, notifications, mute, laws (`--probe`, `--json`) |
|
||||
| `talk setup` | first-time setup in a few questions: language, voices with preview, quiet hours, config.toml |
|
||||
| `talk version` | version and commit (also `talk --version`) |
|
||||
|
||||
Say flags (also for `talk "text"`): `--wait`, `--now`, `--priority`,
|
||||
`--voice`, `--lang`, `--provider`.
|
||||
|
||||
## Installation
|
||||
|
||||
**Release binary** (Linux, macOS, Windows; amd64/arm64): download the
|
||||
matching `talk_<os>_<arch>` from the
|
||||
[releases](https://code.m3ta.dev/m3tam3re/talk/releases), verify the
|
||||
**Release binary** (Linux and Windows, amd64/arm64; macOS builds on
|
||||
request, untested so far): download the matching `talk_<os>_<arch>` from
|
||||
the [releases](https://code.m3ta.dev/m3tam3re/talk/releases), verify the
|
||||
checksum against `checksums.txt`, put it in your PATH as `talk`. No other
|
||||
dependencies.
|
||||
dependencies. The download URL carries the version (Gitea has no
|
||||
`latest/download` alias):
|
||||
|
||||
```console
|
||||
curl -LO https://code.m3ta.dev/m3tam3re/talk/releases/latest/download/talk_linux_amd64
|
||||
sha256sum -c --ignore-missing <(curl -sL https://code.m3ta.dev/m3tam3re/talk/releases/latest/download/checksums.txt)
|
||||
V=v0.1.0
|
||||
curl -LO https://code.m3ta.dev/m3tam3re/talk/releases/download/$V/talk_linux_amd64
|
||||
sha256sum -c --ignore-missing <(curl -sL https://code.m3ta.dev/m3tam3re/talk/releases/download/$V/checksums.txt)
|
||||
install -m 755 talk_linux_amd64 ~/.local/bin/talk
|
||||
```
|
||||
|
||||
|
||||
@@ -112,6 +112,15 @@ var commands = []command{
|
||||
detail: "Asks a few questions for what talk needs to get going: keys (optional; without a key the free Edge voice speaks), a voice per language with preview, quiet hours, and writes config.toml (an existing file is merged, backup .bak). Without a terminal: only shows the effective configuration.",
|
||||
handler: runSetup,
|
||||
},
|
||||
{
|
||||
name: "version",
|
||||
short: "show the version",
|
||||
detail: "Prints the version and, when built from git, the commit. Same as `talk --version`; exists so that a bare `talk version` is not spoken as an announcement.",
|
||||
handler: func(_ []string, _ *sayOptions, _ io.Reader, stdout, _ io.Writer) int {
|
||||
fmt.Fprintln(stdout, versionString())
|
||||
return exitOK
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
// addSayFlags registers the say flags and binds them to the returned options
|
||||
|
||||
@@ -52,6 +52,18 @@ func TestVersionDefault(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
// TestVersionSubcommand: `talk version` prints the version instead of
|
||||
// speaking the word.
|
||||
func TestVersionSubcommand(t *testing.T) {
|
||||
var out, errBuf bytes.Buffer
|
||||
if code := runCLI([]string{"version"}, &out, &errBuf); code != exitOK {
|
||||
t.Fatalf("version: exit code = %d, stderr %q", code, errBuf.String())
|
||||
}
|
||||
if got, want := out.String(), versionString()+"\n"; got != want {
|
||||
t.Errorf("version output = %q, want %q", got, want)
|
||||
}
|
||||
}
|
||||
|
||||
func TestVersionStringWithCommit(t *testing.T) {
|
||||
oldCommit := commit
|
||||
commit = "c0ffee1"
|
||||
|
||||
Reference in new issue
Block a user