Zend Framework Bash Completion Script

If you use the Zend Framework CLI interface much you probably find yourself expecting tab-completion to work.  Well, with this bash completion script it will.  Just add the following line to your .bashrc or .bash_profile:

source path/to/zf.bash

Next time you load the terminal, you can type “zf c” and hit TAB twice to see a list of available commands (change, configure and create” or type “zf cr” and hit TAB to have “create” automatically inserted for you.  The script works for both action names and provider names (but not for anything past that).  Eventually I want the script to dynamically load the available commands (so that it works with custom providers and future versions of ZF without updates) but I couldn’t get that working for this version so I just hard coded them.

There’s also a version that completes commands from the Galahad Framework Extension if you’re testing that out…

Zend Framework CLI Bash Completion Script [1.71 kB]

Enjoy!

Related posts:

  1. Better Zend Framework Documentation If you’ve every tried to navigate the Zend Framework documentation’s...
  2. Zend Framework URI validator & filter For the last couple of months I’ve been incorporating portions...
  3. Zend Framework: Using separate layouts per module Someone was recently asking on ZFTalk about how to use...
  4. Review: Zend Framework 1.8 Web Application Development At the beginning of February PACKT Publishing sent me a...
  5. PHP Modeling (in Zend Framework) I’ve been thinking a lot about Modeling in a MVC...
This entry was posted in Zend Framework and tagged . Bookmark the permalink.
  • http://twitter.com/newmediahub newmediahub

    Chris Morrell posted: Zend Framework Bash Completion Script http://bit.ly/bQTRxy

    This comment was originally posted on Twitter

  • http://twitter.com/raphaelstolt raphaelstolt

    Sweet! A bash completion script for the basic #zf Zend_Tool commands http://is.gd/aQqBe. /by @inxilpro

    This comment was originally posted on Twitter

  • http://twitter.com/teengenerate teengenerate

    RT @raphaelstolt: Sweet! A bash completion script for the basic #zf Zend_Tool commands http://is.gd/aQqBe. /by @inxilpro

    This comment was originally posted on Twitter

  • Pingback: Zend Framework in Action » Chris Morell: Zend Framework Bash Completion Script

  • http://twitter.com/zendframework zendframework

    Zend Framework Bash Completion Script (by Chris Morrell) http://cmorrell.com/web-development/zf/bash-completion-script-751

    This comment was originally posted on Twitter

  • Pingback: Zend Framework News » Blog Archive » Autovervollständigung für Zend_Tool

  • http://twitter.com/addfs addfs

    Zend Framework Bash Completion Script http://bit.ly/a6qTxR

    This comment was originally posted on Twitter

  • http://twitter.com/ostseenetz ostseenetz

    Zend Framework Bash Completion Script http://bit.ly/aZwSC8

    This comment was originally posted on Twitter

  • Pingback: Podpowiadanie komend Zend Framework w bashu

  • udos

    nice! have you thought extending it to doctrine commands also? note: you should place it on your github repository…

  • http://cmorrell.com Chris Morrell

    I haven’t really thought about extending it because I don’t use Doctrine, but if you look at the source you’ll see that it’s pretty straightforward. I’ll throw it up on GitHub soon…

  • http://profiles.google.com/sxndave Dave Stephenson

    Your a legend chris, found your site when looking for info on module specific layouts. Spent ages looking for a bash completion script the other day. Kudos to you!

  • Andreas Jansson

    Was going to write a script like this myself but found yours first which works great! Saved me a couple of hours of procrastination.