Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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.
Comment | File | Size | Author |
---|---|---|---|
#3 | hook_drush_command-987968-3.patch | 3.9 KB | mr.baileys |
#2 | hook_drush_command-987968-2.patch | 11.76 KB | mr.baileys |
#1 | hook_drush_command-987968-1.patch | 4.27 KB | mr.baileys |
Comments
Comment #1
mr.baileysHere's a first stab at this.
Comment #2
mr.baileysAttached the wrong file in #1.
Comment #3
mr.baileysAck, sorry... Seems I'm not yet an experienced git user, the previous patch removes the sandwhich file, which obviously should not happen.
Final attempt.
Comment #4
greg.1.anderson CreditAttribution: greg.1.anderson commentedOthers 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.
Comment #5
moshe weitzman CreditAttribution: moshe weitzman commentedYes, 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.
Comment #6
Dave ReidAccording to includes/bootstrap.inc, the default is actually DRUSH_BOOTSTRAP_DRUPAL_FULL. Is this wrong and need to be corrected or does bootstrap.inc?
Comment #7
Dave ReidAlso, 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. :/
Comment #8
moshe weitzman CreditAttribution: moshe weitzman commentedThe default for a command is LOGIN. Any docs that say otherwise are wrong.
Comment #9
Dave ReidThanks - I filed #1245668: Inconsistent or missing documentation on default bootstrap level for commands as a separate issue then.
Comment #10
q0rban CreditAttribution: q0rban commentedI 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`."
Comment #11
ergonlogic+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.
Comment #12
moshe weitzman CreditAttribution: moshe weitzman commentedAdded brief doc with references. Committed to drush 4 and 5