Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #3
Adds support for
fish
using their guide for writing custom completionsI've managed to get this working smoothly on my machine using a Oclif tool and would love a couple of other testers.
Recording
Details
Automatically detects the correct path to store fish completion files in using
pkg-config
to detect the "completionsdir" variable. This comes from the advice on that page:This will operate slightly different than how
bash
andzsh
operate. Since those shells require you to add lines to you.bashrc
or.zshrc
in order to source the functions file, they necessitated a "setup" file as well as a manual addition to the configs.fish
on the other hand will automatically detect completions by name in the completions folder, and so does not require a setup script, or manual intervention by the user. We'll simply write the completions to the appropriate directory.Since we're now dealing with three shells instead of two, I've refactored some of the
index.ts
module to rely on some private methods with switch/case statements instead of the ternary used previously.