add --show-grant argument to wp cap list and --grant to wp cap add#19
add --show-grant argument to wp cap list and --grant to wp cap add#19schlessera merged 5 commits intowp-cli:masterfrom
Conversation
There was a problem hiding this comment.
Thanks for the PR, @kshaner!
The code looks good, I just requested changes for a lot of nitpicky things like code style and comments.
src/Capabilities_Command.php
Outdated
| * --- | ||
| * | ||
| * [--show-grant] | ||
| * : Display all capabilites defined for role including grant |
There was a problem hiding this comment.
Typo: capabilites => capabilities
src/Capabilities_Command.php
Outdated
| public function list_( $args, $assoc_args ) { | ||
| $role_obj = self::get_role( $args[0] ); | ||
|
|
||
| $show_grant = !empty( $assoc_args['show-grant'] ); |
src/Capabilities_Command.php
Outdated
| } | ||
| } | ||
|
|
||
There was a problem hiding this comment.
Code style: Unneeded indentation
src/Capabilities_Command.php
Outdated
| public function add( $args, $assoc_args ) { | ||
| self::persistence_check(); | ||
|
|
||
There was a problem hiding this comment.
Code style: Unneeded indentation
src/Capabilities_Command.php
Outdated
|
|
||
| foreach ( $args as $cap ) { | ||
| if ( !$role_obj->has_cap( $cap ) ) | ||
| if ( !isset( $role_obj->capabilities[ $cap ] ) ) |
src/Capabilities_Command.php
Outdated
|
|
||
| $role_obj = self::get_role( $role ); | ||
|
|
||
| $grant = !isset( $assoc_args['grant'] ) || !empty( $assoc_args['grant'] ); |
src/Capabilities_Command.php
Outdated
| * --- | ||
| * | ||
| * [--show-grant] | ||
| * : Display all capabilites defined for role including grant |
There was a problem hiding this comment.
Code Style: Comment should end with a period: .
src/Capabilities_Command.php
Outdated
| * : One or more capabilities to add. | ||
| * | ||
| * [--grant] | ||
| * : Add the capability as true/false |
There was a problem hiding this comment.
Code Style: Comment should end with a period: .
There was a problem hiding this comment.
I'd reword this to make it clearer.
How about:
Adds the capability as an explicit boolean value, instead of implicitly defaulting to `true`.
|
Thanks @schlessera. I've addressed the spacing and agree with your updated comment. It looks like the travis-ci build ran out of memory on the check though. Not sure how I can address that. |
|
@kshaner Thanks for the good work on this. I've fixed the memory issue for the Travis 5.3 branch. If you merge the latest changes from master, the tests should pass. |
|
@schlessera, Thanks for fixing the php memory limit. All checks pass now! |
add --show-grant argument to wp cap list and --grant to wp cap add
Addresses #18