This patch accomplishes a number of things:

  1. Renames 'hook' to 'fn-hook', aliased to 'hook'.
  2. 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.
  3. Shows the doxygen comment before the implementation of the function, if any.
  4. 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.

CommentFileSizeAuthor
#4 fn-impl.patch4.39 KBgreg.1.anderson

Comments

moshe weitzman’s picture

I'm tempted to move development commands like these to devel module. Any objections? We'll focus drush core on site administration

greg.1.anderson’s picture

Yeah, that would be fine by me.

moshe weitzman’s picture

Status: Needs review » Active

Forgot to upload? No patch here.

greg.1.anderson’s picture

Status: Active » Needs review
StatusFileSize
new4.39 KB

Whoops. Here you go.

I could also post this against devel, if you prefer.

moshe weitzman’s picture

yes, 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.

moshe weitzman’s picture

Status: Needs review » Fixed

Committed 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.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.