Problem/Motivation

Part of #3582246: [meta] CLI in Core community initiative. Referenced from theCLI in Core Initiative spreadsheet.

Steps to reproduce

Testing commands

Try the filtering options provided in help for the command.
Try the output format options.

Proposed resolution

Allows a console user to list modules and themes by package, version, name and machine name, and installation status, and provides filtering option by name, extension type, package and installation type. Allows the user to output as a table, YAML or JSON introducing those keys in a new enum.

Remaining tasks

User interface changes

N/A

Introduced terminology

N/A

API changes

Adds a new output format enum for console output.

Data model changes

No

Release notes snippet

Issue fork drupal-3594336

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

mradcliffe created an issue. See original summary.

moshe weitzman’s picture

Assigned: Unassigned » moshe weitzman

I'll take this one.

moshe weitzman’s picture

Title: Add a command to inventory modules and themes on a site » Add a command to list modules and themes on a site
Status: Active » Needs review

A table listing modules and themes and their key properties. Also offers json and yaml as alternative output formats.

Needs review.

nicxvan’s picture

Is there a reason to not list profiles and database drivers too?

Themes and modules are the most common obviously.

nicxvan’s picture

Component: system.module » extension system
Status: Needs review » Needs work

A few questions and comments.

I could be convinced profile and database drivers should be a follow up, but I think it's probably not too much to include here.

Thanks for putting this together!

nicxvan’s picture

Moshe mentioned in slack that Drush doesn't support listing database drivers or profiles and has never had a request for it.

I think profiles might be useful, but it can be a follow up.

As for pm:info I created #3605796: Discuss creating a pm:info command

There is a CR, not sure if we want more detail on the options, but I think it's good.

Still need to manually test the options.

nicxvan’s picture

Status: Needs work » Reviewed & tested by the community

Ok I manually tested:
type for both options.
format for both options.
core
installed
and I tested package with Core and changed a module to use a test package and confirmed it works as well.

needs-review-queue-bot’s picture

Status: Reviewed & tested by the community » Needs work
StatusFileSize
new91 bytes

The Needs Review Queue Bot tested this issue. It no longer applies to Drupal core. Therefore, this issue status is now "Needs work".

This does not mean that the patch necessarily needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.

Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.

mradcliffe’s picture

Issue summary: View changes
Status: Needs work » Needs review

I rebased the merge request, and then filled out the issue summary.

nicxvan’s picture

Status: Needs review » Reviewed & tested by the community

I think we can make the final decision on the console line length in a follow up.

Rebase looks good.

Honestly I think 120 on a console is fine.

mradcliffe’s picture

I'll create a follow-up shortly.

mradcliffe’s picture

I created #3611694: Decide and implement table formatting for console command output for further discussion, standardization and implementation.

vidit.anjaria’s picture