diff --git a/src/Drupal/Commands/core/RoleCommands.php b/src/Drupal/Commands/core/RoleCommands.php index 70752e0d69..ddba159c7c 100644 --- a/src/Drupal/Commands/core/RoleCommands.php +++ b/src/Drupal/Commands/core/RoleCommands.php @@ -21,8 +21,6 @@ class RoleCommands extends DrushCommands implements SiteAliasManagerAwareInterfa * @command role:create * @param $machine_name The symbolic machine name for the role. * @param $human_readable_name A descriptive name for the role. - * @usage drush role:create 'test role' - * Create a new role 'test role'. On D8, the human-readable name will be 'Test role'. * @usage drush role:create 'test role' 'Test role' * Create a new role with a machine name of 'test role', and a human-readable name of 'Test role'. * @aliases rcrt,role-create @@ -31,7 +29,7 @@ public function create($machine_name, $human_readable_name = null) { $role = Role::create([ 'id' => $machine_name, - 'label' => $human_readable_name, + 'label' => $human_readable_name ?: ucfirst($machine_name), ], 'user_role'); $role->save(); $this->logger()->success(dt('Created "!role"', ['!role' => $machine_name]));