lunchy: command not found : complete when using bash completion

Hello,

I have added the code for completion in my .bash_profile file and when I source it, I have the following error :

rvm/gems/ruby-2.0.0-p598/gems/lunchy-0.10.1/lib/../extras/lunchy-completion.bash:18: command not found: complete

Looks like the command used there https://github.com/eddiezane/lunchy/blob/5640b8a47720adeb085924994aaabe07c80ee212/extras/lunchy-completion.bash#L18 isn’t available on my system (OSX 10.10.4).

Thanks for your help.

About this issue

  • Original URL
  • State: closed
  • Created 9 years ago
  • Reactions: 5
  • Comments: 18 (4 by maintainers)

Commits related to this issue

Most upvoted comments

zsh have a bash completion script compatibility mode, you need to run :

autoload bashcompinit
bashcompinit

before sourcing the bash completion file. I have tested it and it works partially (listing the lunchy command is ok but not listing of the plist files).

I’ll investigate and try to find a solution to have a working completion for ZSH.

this is the only thing that worked for me. got it from here https://github.com/creationix/nvm/pull/1780/files

added this to the top of my .zshrc

autoload -U +X bashcompinit && bashcompinit
autoload -U +X compinit && compinit
autoload bashcompinit
bashcompinit

On top of .zshrc works! 👍

Are you using bash as your shell? If not, this completion script won’t help and you should probably leave it out of your profile/bashrc.

If you are using bash, do you have bash_completion installed? If not, or you can try installing it via homebrew.

You can check to see if bash_completion is available (assuming you have homebrew).

brew list

you should see bash_completion in the list. If not then install it

brew install bash_completion

Then restart your terminal and see if that works.

If you get this far and things are still not working, let us know and we’ll try to get it figured out. Please include the version of bash, the list of brew packages.

autoload bashcompinit bashcompinit I tried this, but it didn’t work for me.

For those who were not able to make it work, just paste those two lines in your ~/.zshrc file right before the source filethathascompletion.bash line

My bad, I’m using zsh 😦 Thanks for your quick answer.

this is the only thing that worked for me. got it from here https://github.com/creationix/nvm/pull/1780/files

added this to the top of my .zshrc

autoload -U +X bashcompinit && bashcompinit
autoload -U +X compinit && compinit

This for sure worked!