Skip to content

Add a wp user exists subcommand #484

Closed

Description

@kkmuffme

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.

Activity

  1. swissspidy commented on Mar 4, 2024

    @swissspidy
    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.

  2. transferred this issue fromwp-cli/ideason Mar 4, 2024
  3. added this to the 2.6.3 milestone on Mar 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions