click-contrib / click-completion

Add or enhance bash, fish, zsh and powershell completion in Click
MIT License
288 stars 32 forks source link

fish completion config fix #1

Closed west-rynes closed 7 years ago

west-rynes commented 7 years ago

I noticed something that may be an error in the documentation.

In your documentation is states to put in ~/.config/fish/completions/foo-bar.fish

eval (_FOO_BAR_COMPLETE=source-fish foo-bar)

First, on my system it appears that ~/.config/fish/completions/ is not loaded in fish. Maybe you are using omf or some other scripts that load that subdir's scripts? I just have a plain fish install and it does not appear to look in the completions subdir (I'm on a mac and installed fish version 2.4.0 using brew) Secondly, the code you listed to load the completions raises following error when I try it:

Unsupported use of '='. To run 'foo-bar' with a modified environment, please use 'env _FOO_BAR_COMPLETE=source-fish foo-bar…' in command substitution

However, everything works if I put the following in ~/.config/fish/config.fish

eval (env _FOO_BAR_COMPLETE =source-fish foo-bar)

So I'm not sure if the documentation should be updated or if there is something weird on my system? Just thought I'd let you know.

Thanks for the nice work on this plugin. Once I made the above changes it works great.

glehmann commented 7 years ago

Hi,

I've just fixed the missing env in the README.

The configuration path looks ok to me. I'm running a click-completion application in completely controlled environments (docker containers and vagrant images) without any problem with this path. Could you give me you fish version and your OS?

Thanks for your feedback!

glehmann commented 7 years ago

No precision provided by the reporter

flokno commented 5 years ago

follow up: the env is still missing in _FOO_BAR_COMPLETE=source-fish foo-bar > ~/.config/fish/completions/foo-bar.fish in the README.