I'm happy to look at coding this as I have the time (It won't be before April 2015) but I think Drush support for this module would be extremely useful.

Comments

ndf’s picture

Status: Active » Needs review

Think your right with that.
Currently we have 2 functions (one for projects and one for modules) that handle theming (a.k.a. rendering the page).

/**
 * Page callback.
 *
 * Returns a table with orphaned projects.
 *
 * @param string $op
 *   Either 'all' or 'disabled'.
 *
 * @return string
 *   themed table.
 */
function unused_modules_show_projects($op = 'all') {
/**
 * Page callback.
 *
 * Returns a table with orphaned modules.
 *
 * @param string $op
 *   Either 'all' or 'disabled'.
 *
 * @return string
 *   themed table.
 */
function unused_modules_show_modules($op = 'all') {

For those 2 function we should create a Drush sibling.

In total there are 4 page-callbacks (so 4 variants):

  1. Projects All
  2. Projects Disabled
  3. Modules All
  4. Modules Disabled

While I was typing this I thought, let's just do it. Patch is pushed to -dev branch.

$ drush unused-modules --help
Show modules and projects that are unused.

Examples:
 Show projects that are unused.            drush unused-modules projects disabled 
 As above, shorthand.                      drush um                               
 As above, include projects with enabled   drush unused-modules projects disabled 
 modules.                                                                         
 Show modules that are unused.             drush unused-modules modules disabled  
 As above, include enabled modules.        drush unused-modules modules disabled

Arguments:
 type                                      Show modules or projects (defaults to Projects)                                              
 show                                      Options "all" and "disabled". Show only disabled modules (defaults to disabled and enabled.)

Aliases: um, unused_modules
ndf’s picture

Status: Needs review » Fixed
ndf’s picture

Version: 7.x-1.x-dev » 7.x-1.3

Status: Fixed » Closed (fixed)

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