Closed kkmuffme closed 7 months ago
Sounds reasonable 👍 There are already similar commands such as wp post exists
and wp comment exists
.
We could consider adding an exists
command for all entities that have a get
command already, for consistency.
Feature Request
Describe your use case and the problem you are facing
Using
wp user get
writes to stderr when the user doesn't exist, which makes it porcelain, since it needs to be parsed and processed to be able to distinguish between user doesn't exist and unrelated errors.Describe the solution you'd like
There should be a command like
wp user exists
to check whether a user exists or not, returning 0 on success, 1 if it doesn't exist and not write anything to stderr in that case. Like wp plugin is-active which does this for plugins.