Skip to content

Incorrect success message when adding an alias without an @ symbol #5391

Description

@johnbillion

Bug Report

Describe the current, buggy behavior

Adding an alias but forgetting its leading @ symbol results in an invalid alias being added, and a success message being shown to the user.

Describe how other contributors can replicate this bug

  • Run wp cli alias add hello --set-path=/ and observe a success message
  • Run wp @hello help and observe the alias does not exist
  • Run wp cli alias list and observe the alias is not listed
  • Open your ~/wp-cli/config.yml file and observe that the alias was added without a leading @ symbol

Describe what you expect as the correct outcome

I would like the wp cli alias commands to work both with and without the leading @ symbol, with one being added as necessary behind the scenes.

The --grouping flag appears to be the only place in WP-CLI where the leading @ symbol is optional. Both of the following work:

  • wp cli alias add @foo --grouping=bar,baz
  • wp cli alias add @foo --grouping=@bar,@baz

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      Sponsor
      SponsoredKunjungi sekarang
      Promo