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.
  • All modules in the current Drupal installation whether they are enabled or not. Commands implementing hook_drush_load() in with a return value FALSE will not be loaded.

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


5 calls to drush_commandfile_list()
drush_command_implements in includes/
Determine which command files are implementing a hook.
drush_command_include in includes/
Conditionally include files based on the command used.
drush_get_commands in includes/
Get a list of all implemented commands. This invokes hook_drush_command().
drush_get_engines in includes/
Return a structured array of engines of a specific type from commandfiles implementing hook_drush_engine_$type.
drush_invoke in includes/
Invoke drush api calls.


includes/, line 488
The drush command engine.


function drush_commandfile_list() {
  return drush_get_context('DRUSH_COMMAND_FILES', array());