Can a Bash tab-completion script be used in zsh?

Coderer picture Coderer · Jul 14, 2010 · Viewed 38.9k times · Source

I have a Bash tab-completion script for Apache's Hadoop. Normally, I use zsh as my day-to-day shell. It tends to be pretty bash-like when I need it to be, but it looks like the tab-completion systems are radically different between them. Is there a simple way to "convert" the existing bash-tab-completion definitions to work in zsh? I don't want to invest a ton of time in this, but if it's easy I'd save a moderate amount of effort.

Answer

freestyler picture freestyler · Dec 13, 2011
autoload bashcompinit
bashcompinit
source /path/to/your/bash_completion_file