Fish autocomplete doesn't work with `inv` command

Open
#1,036 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
38/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
fish, python
Domain
cli

Research direction

Start with invoke/completion/fish.completion at the linked revision, then trace the built-in template logic and completion installation path. Confirm how the {binary} placeholder is expanded and how invoke.fish is installed. Done means fish recognizes both inv and invoke and autoloading works for inv.fish.

Written by the indexing model from the issue text.

Description

Two things need to be done to fix this.

In order for fish to recognize inv as a supported command, pass ---comand inv to complete in addition to --comand invoke.

https://github.com/pyinvoke/invoke/blob/2a8f95fa50e73f1520f8eb0463a8e51321290d98/invoke/completion/fish.completion#L10

Additionally, for completion autoloading to work, the inv.fish file needs to be system linked to invoke.fish.

I would contribute a fix, but it looks like you use {binary} instead of hard-coding invoke. The built-in template logic has no way to expand ["inv", "invoke"] to "--command invoke --comand inv". The second issue with a fix is that I don't know to install inv.fish alongside invoke.fish.

Are you okay with hardcoding --command inv in the completion file, and how would I modify the logic for installing completions?

Dominant language
Python
Stars
4.8k
Forks
412
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from pyinvoke/invoke

All issues in pyinvoke/invoke

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.