netz98/n98-magerun — pull request #300 by allardhoeve (2014-02-11 12:02:50+00:00)
Title: Implement bash completion in bash

This PR reimplements bash completion in bash. This prevents a second forking of PHP just to parse the options. This is marginally faster :)

Issue: netz98/n98-magerun#294

I would like to implement bash completion for more than just top-level `magerun`. This could be implemented by looking for the first entry in `COMP_WORDS` that is not an `--option` and putting that in $subcommand. Then we could run ``magerun help $subcommand` and parse the sub options.

If we want to implement filename completion for e.g. `magerun db:import`, we need to have code support for certain commands, because parsing `magerun help` does not help us here.