Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JayKandari/82ec7f3d96d191554d46c9cac8eb5eb1 to your computer and use it in GitHub Desktop.
Save JayKandari/82ec7f3d96d191554d46c9cac8eb5eb1 to your computer and use it in GitHub Desktop.
Drush pm:list filter - Using regular expression to filter specific modules to show in `drush pml` command.
drush pml --filter='name~=#(mymodule1|mymodule2|mymodule3)#i'
# Output:
# -------------- ------------------------------------------- ---------- ---------
# Package Name Status Version
# -------------- ------------------------------------------- ---------- ---------
# My package My Module (mymodule1) Disabled
# Another pack Another module (mymodule2) Enabled
# My package My Module (mymodule3) Disabled
# -------------- ------------------------------------------- ---------- ---------
@JCL324
Copy link

JCL324 commented Oct 20, 2022

What version of Drush? I'm using 10.4.3 and although the help says --filter is allowed, I get The "--filter" option does not exist.

@liberatr
Copy link

liberatr commented Oct 24, 2022

Drush Commandline Tool 10.6.2
drush pm:list --filter='name~=#(webform|xmlsitemap|path_redirect_import)#i'
Works

@JCL324
Copy link

JCL324 commented Oct 24, 2022

With the help from @liberatr, apparently doing a drush cr did the trick! My 10.4.3 now works!

@liberatr
Copy link

If you are having trouble drush cr before you run this command. see drush-ops/drush#4264

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment