This patch accomplishes a number of things:
- Renames 'hook' to 'fn-hook', aliased to 'hook'.
- Adds a new 'fn-impl' command, aliased to 'impl'. This function works like 'hook', but takes the full function name, skipping the multiple-choice selection that 'hook' has. Note that any function can be viewed in this way, not just hooks.
- Shows the doxygen comment before the implementation of the function, if any.
- Implements the function display code in php rather than sed
Naming conventions are somewhat debatable, I suppose. I was also planning 'fn-module', to show all of the hooks defined in a named module. That's not implemented yet, but it would make a suite of "fn" commands. I'm open for other suggestions.
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | fn-impl.patch | 4.39 KB | greg.1.anderson |
Comments
Comment #1
moshe weitzman commentedI'm tempted to move development commands like these to devel module. Any objections? We'll focus drush core on site administration
Comment #2
greg.1.anderson commentedYeah, that would be fine by me.
Comment #3
moshe weitzman commentedForgot to upload? No patch here.
Comment #4
greg.1.anderson commentedWhoops. Here you go.
I could also post this against devel, if you prefer.
Comment #5
moshe weitzman commentedyes, patch against devel would be ideal.
I'm pretty interested in showing methods here too. They are getting popular in D7. See http://www.php.net/manual/en/class.reflectionmethod.php. I think we should use same drush command for both. We could require a syntax like class::method or assume method if there are 2 arguments.
Comment #6
moshe weitzman commentedCommitted to devel. In addition to showing methods, we need some better error handling when the supplied hook has no implementations or the supplied function does not exist.