Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

bashcompinit: sourcing /etc/bash_completion



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I've looked into loading /etc/bash_completion from the bash-completion
project, but it fails.

I am using the following function:

  # Load bash completion system
  # via http://zshwiki.org/home/convert/bash
  autoload -U bashcompinit
  bash_source() {
    alias shopt=':'
    alias _expand=_bash_expand
    alias _complete=_bash_comp
    emulate -L sh
    setopt kshglob noshglob braceexpand
  
    # setopt bashrematch dotglob hashall physical
    have() {
      unset have
      (( ${+commands[$1]} )) && have=yes
    }
  
    source "$@"
  }

It fails with the following line:

    local cword words=()

(/usr/share/bash-completion/bash_completion:305: parse error near `()')


Would it be possible to have a `emulate -L bash` to help with this?
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iD8DBQFVeJlufAK/hT/mPgARAkL8AJ9wYN4ipiH1snLuPNVMW5yfCtxdqACgpMlZ
gckUAcsu74G9Y+Bk2MwobNw=
=xgZ6
-----END PGP SIGNATURE-----



Messages sorted by: Reverse Date, Date, Thread, Author