Directory

Add a `wp user exists` subcommand · Issue #484 · wp-cli/entity-command · GitHub
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

Add a wp user exists subcommand #484

Closed
1 task done
kkmuffme opened this issue Mar 4, 2024 · 1 comment · Fixed by #486
Closed
1 task done

Add a wp user exists subcommand #484

kkmuffme opened this issue Mar 4, 2024 · 1 comment · Fixed by #486

Comments

@kkmuffme
Copy link

kkmuffme commented Mar 4, 2024

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.

@swissspidy
Copy link
Member

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.

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

Successfully merging a pull request may close this issue.

3 participants