WordPress / plugin-check

A repository for the new Plugin Check plugin from the WordPress Performance and Plugins Team.
https://wordpress.org/plugins/plugin-check/
GNU General Public License v2.0
198 stars 39 forks source link

Improve parsing of associative arguments to accept arguments regardless of position #364

Closed ernilambar closed 6 months ago

ernilambar commented 6 months ago

Command 1:

wp plugin check hello.php --fields=line,column,type,code

Command 2:

wp plugin check --fields=line,column,type,code hello.php

These both commands are expected to give same output. But it seems our CLI breaks when assoc args are passed before the plugin slug parameter.

PHP fatal error:

Fatal error: Uncaught Exception: Invalid plugin slug: Plugin with slug --fields=line,column,type,code is not installed. in /var/www/html/wp-content/plugins/plugin-check/includes/Utilities/Plugin_Request_Utility.php:77
swissspidy commented 6 months ago

Only a problem because of the way we use CLI_Runner 😞 Otherwise WP-CLI would handle this just fine. Good catch!