function drush_commandfile_list

8.0.x drush_commandfile_list()
6.x drush_commandfile_list()
7.x drush_commandfile_list()
3.x drush_commandfile_list()
4.x drush_commandfile_list()
5.x drush_commandfile_list()
master drush_commandfile_list()

Collect a list of all available drush command files.

Scans the following paths for drush command files:

  • The "/path/to/drush/commands" folder.
  • Folders listed in the 'include' option (see example.drushrc.php).
  • The system-wide drush commands folder, e.g. /usr/share/drush/commands
  • The ".drush" folder in the user's HOME folder.
  • /drush and sites/all/drush in current Drupal site.
  • Folders belonging to enabled modules in the current Drupal site.

A Drush command file is a file that matches "*".

Return value

An associative array whose keys and values are the names of all available command files.

See also


8 calls to drush_commandfile_list()
commandUnitCase::testCommandVersionSpecific in tests/commandUnitTest.php
Assure that matching version-specific command files are loaded and others are ignored.
drush_command_get_includes in includes/
drush_command_implements in includes/
Determine which command files are implementing a hook.
drush_docs_errorcodes in commands/core/
docs-errorcodes command. Print a list of all error codes that can be found.
drush_enforce_requirement_drush_dependencies in includes/
Check that a command has its declared drush dependencies available or have no dependencies. Drush dependencies are helpful when a command is invoking another command, or implementing its API.

... See full list


includes/, line 1575
The drush command engine.


function drush_commandfile_list() {
  return commandfiles_cache()->get();