yvoronoy / magento2-bash-completion

Magento2 Bash Completion
MIT License
140 stars 29 forks source link

complete from bin/magento #12

Open WileESpaghetti opened 7 years ago

WileESpaghetti commented 7 years ago

We don't have the magento command installed globally on most of our servers, so we typically call the command with bin/magento from the web root.

Adding bin/magento to the list passed to complete at the end of the file fixes the issue for us.

complete -o default -F _magento2 magento bin/magento
yvoronoy commented 7 years ago

Thank you for reporting. Actually, I use bin/magento and it's works for me. I've tested on OSX and centos. Could you provide what OS do you use? And what bash version is?

WileESpaghetti commented 7 years ago

It's the bash that comes with kubuntu 16.10

bash --version
GNU bash, version 4.3.46(1)-release (x86_64-pc-linux-gnu)
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>

This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

My bashrc has a couple of other completions loaded too, so it could be something there too. Here's the part I added to the default.

export GOPATH=$HOME/Workspace/gocode
export PATH=$PATH:$GOPATH/bin:$HOME/bin:$HOME/bin/go_appengine

export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh"  # This loads nvm

export JAVA_HOME=$HOME/bin/jdk
export PATH=$PATH:$JAVA_HOME/bin
alias docker_clean_images='docker rmi $(docker images -a --filter=dangling=true -q)'
alias docker_clean_ps='docker rm $(docker ps --filter=status=exited --filter=status=created -q)'
alias 64d='base64decode'
source /usr/lib/google-cloud-sdk/completion.bash.inc

# https://kubernetes.io/docs/user-guide/kubectl/kubectl_completion/
source <(kubectl completion bash)

# sudo curl -o /etc/bash_completion.d/magento2-bash-completion https://raw.githubusercontent.com/yvoronoy/magento2-bash-completion/master/magento2-bash-completion-enterprise
source $HOME/bin/magento2-bash-completion-enterprise