Skip to content

wp user remove-role <id> with no role arguments could produce a less scary display result #291

@lkraav

Description

@lkraav

Bug Report

Describe the current, buggy behavior

wp user set-role with no [role] argument is documented as "adds the default role".

But matching remove-role synopsis is undocumented and also produces a scary display result:

[cxl ~/www]# wp user remove-role 293
Success: Removed leho (293) from <site>.

This looks like my user just got wiped. Fortunately it's not the case, as wp user get confirmed.

Describe how other contributors can replicate this bug

See commands above.

Describe what you would expect as the correct outcome

a) user remove-role should not proceed without a [role] parameter
b) match set-role strategy and remove default role + add documentation

Let us know what environment you are running this on

# wp cli info
OS:     Linux 2.6.32-754.17.1.el6.x86_64 #1 SMP Tue Jul 2 12:42:48 UTC 2019 x86_64
Shell:  /bin/bash
PHP binary:     /opt/cpanel/ea-php73/root/usr/bin/php
PHP version:    7.3.16
php.ini used:   /opt/cpanel/ea-php73/root/etc/php.ini
WP-CLI root dir:        phar://wp-cli.phar/vendor/wp-cli/wp-cli
WP-CLI vendor dir:      phar://wp-cli.phar/vendor
WP_CLI phar path:       /home/convers/public_html
WP-CLI packages dir:    /home/convers/.wp-cli/packages/
WP-CLI global config:
WP-CLI project config:
WP-CLI version: 2.4.0

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions