Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,14 @@ homebrew_casks:
- name: things
binaries:
- things
# Run `things completions <shell>` at cask install time to drop bash/zsh/fish
# completion scripts into the Homebrew prefix. `<shell>` is a positional arg
# (shell_parameter_format: arg) — matches the CLI added in #88 PR 1.
generate_completions_from_executable:
args: [completions]
base_name: things
shell_parameter_format: arg
shells: [bash, zsh, fish]
repository:
owner: ryanlewis
name: homebrew-tap
Expand All @@ -69,8 +77,12 @@ homebrew_casks:
name: goreleaserbot
email: bot@goreleaser.com
commit_msg_template: "chore(brew): {{ .ProjectName }} {{ .Tag }}"
# De-quarantine in preflight (before artifact install) rather than postflight,
# so the binary is runnable when generate_completions_from_executable invokes
# it during install — otherwise Gatekeeper blocks the unsigned binary and no
# completion files are written.
hooks:
post:
pre:
install: |
if OS.mac?
system_command "/usr/bin/xattr", args: ["-dr", "com.apple.quarantine", "#{staged_path}/things"]
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -355,11 +355,11 @@ goes stale as the command surface changes — `things <TAB>` completes
subcommands and flag names, and a flag's values complete once you've typed it
(`things list --color <TAB>` → `auto`, `always`, `never`).

The Homebrew cask installs the binary but doesn't generate completions yet —
that's a planned follow-up. Until it lands, and on every install path, load the
script yourself. Completion shells out to `things` by name, so it works as long
as `things` is on your `PATH` (the Homebrew, `go install`, and `make install`
paths all put it there):
The Homebrew cask generates these on install, so cask users get `things <TAB>`
with no extra steps. On every other install path, load the script yourself.
Completion shells out to `things` by name, so it works as long as `things` is on
your `PATH` (the Homebrew, `go install`, and `make install` paths all put it
there):

```sh
# bash — add to ~/.bashrc (complete -C is a bash builtin; no extra package needed)
Expand Down
2 changes: 1 addition & 1 deletion internal/skill/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ things --json list today | jq '.[] | .title'

## Shell completions

`things completions <bash|zsh|fish>` prints a completion script for that shell. It delegates back to the binary (which must be on `PATH`), so it stays in sync with the CLI surface. The Homebrew cask installs the binary but doesn't generate completions yet (a planned follow-up); for now the user loads it with `source <(things completions zsh)` (bash/zsh) or `things completions fish | source`. Completion is flag/subcommand-name only — it never reads the Things database.
`things completions <bash|zsh|fish>` prints a completion script for that shell. It delegates back to the binary (which must be on `PATH`), so it stays in sync with the CLI surface. The Homebrew cask generates these on install; on other install paths the user loads it with `source <(things completions zsh)` (bash/zsh) or `things completions fish | source`. Completion is flag/subcommand-name only — it never reads the Things database.

## Tips

Expand Down