drush_hook_COMMAND is there, but hook_drush_command, the one that returns the array of commands, is not described. I never noticed it was missing before.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

mr.baileys’s picture

Status: Active » Needs review
FileSize
4.27 KB

Here's a first stab at this.

mr.baileys’s picture

Attached the wrong file in #1.

mr.baileys’s picture

Ack, sorry... Seems I'm not yet an experienced git user, the previous patch removes the sandwhich file, which obviously should not happen.

Final attempt.

greg.1.anderson’s picture

Others may have differing opinions, but here is my highly-subjective viewpoint.

Rather than duplicate the description from includes/command.inc, just have a forward-reference to it.

Rather than duplicate the 'mmas' example, compose a different, simpler example.

moshe weitzman’s picture

Status: Needs review » Needs work

Yes, reference rather than copy. Same for the sandwich command.

So, what is needed here IMO is just to mention hook_drush_command with@see references to `drush topic docs-commands` and `docs-examplecommand`. We could alternatively reference those files instead of `drush topic` if doxygen prefers that.

Dave Reid’s picture

+++ docs/drush.api.phpundefined
@@ -73,6 +73,87 @@
+ *   - bootstrap: the minimum bootstrap level required by this command. See
+ *     includes/environment.inc for a list of bootstrap phases. If not
+ *     specified, the default bootstrap level is DRUSH_BOOTSTRAP_DRUPAL_LOGIN.

According to includes/bootstrap.inc, the default is actually DRUSH_BOOTSTRAP_DRUPAL_FULL. Is this wrong and need to be corrected or does bootstrap.inc?

Dave Reid’s picture

Also, I would like to support having these docs inside the api.php files so that they can be viewed when someone searches for hook_drush_command() when using API module, otherwise having an api.php file is kinda pointless. :/

moshe weitzman’s picture

The default for a command is LOGIN. Any docs that say otherwise are wrong.

Dave Reid’s picture

q0rban’s picture

I agree with #7. It should be in the api.php if only for searchability. Even if it says, "Hey oatbag, type `drush topic docs-commands`."

ergonlogic’s picture

+1 for #7 and #10. I practically live in api.drush.org whenever I'm working on Drush extensions, and I've missed this hook documentation a couple times. Since I'm now looking to upgrade drush-vagrant from Drush 4.x to 5.x, I'd find this helpful to be able to easily see changes between versions.

moshe weitzman’s picture

Status: Needs work » Fixed

Added brief doc with references. Committed to drush 4 and 5

Status: Fixed » Closed (fixed)

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