Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wp theme list show multiple status #224

Open
wpbullet opened this issue Apr 6, 2020 · 3 comments
Open

wp theme list show multiple status #224

wpbullet opened this issue Apr 6, 2020 · 3 comments

Comments

@wpbullet
Copy link

wpbullet commented Apr 6, 2020

I am creating an audit script and noticed that you cannot use more than one status with the wp theme list command.

Here is an example on a live site:

wp theme list

Output

+----------------+--------+--------+---------+
| name           | status | update | version |
+----------------+--------+--------+---------+
| woodmart-child | active | none   | 1.0.0   |
| woodmart       | parent | none   | 4.4.0   |
+----------------+--------+--------+---------+

I can filter by one status

wp theme list --status=active

Output

+----------------+--------+--------+---------+
| name           | status | update | version |
+----------------+--------+--------+---------+
| woodmart-child | active | none   | 1.0.0   |
+----------------+--------+--------+---------+

But if I try to get both the active and parent status in one command it fails

wp theme list --status=active,parent

Output

+------+--------+--------+---------+
| name | status | update | version |
+------+--------+--------+---------+
+------+--------+--------+---------+
@swissspidy
Copy link
Member

Sounds like it might be looking for a status called active,parent and not actually doing any splitting to filter by both.

So this would be more of an enhancement. I'd be open to accept a PR that covers all relevant commands and also clearly documents the behavior. Would also be good to check other commands as well to ensure they all behave similarly.

@thelovekesh
Copy link
Member

@swissspidy IMO It's hard to guess whether the user wants to pass comma-separated strings as multiple strings or the string itself contains the comma. In this case, we can explore the strategy to pass a flag multiple times in case multiple values are intended for a flag.

Example:

$ wp --flag=option1 --flag=option2
# It will be parsed by CLI as `$flag = [ 'option1', 'option2' ]`

$ wp --flag=option1,option2
# It will be parsed by CLI as `$flag = [ 'option1,option2' ]`

@danielbachhuber
Copy link
Member

Related #159

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

No branches or pull requests

4 participants