public function add_role( $args, $assoc_args ) {
		$user = $this->fetcher->get_check( $args[0] );

		$role = $args[1];

		self::validate_role( $role );

		$user->add_role( $role );

		WP_CLI::success( "Added '{$role}' role for {$user->user_login} ({$user->ID})." );
	}
public function add_role( $args, $assoc_args ) {
		$user = $this->fetcher->get_check( $args[0] );

		$role = $args[1];

		self::validate_role( $role );

		$user->add_role( $role );

		WP_CLI::success( "Added '{$role}' role for {$user->user_login} ({$user->ID})." );
	}
public function add_role ( $ args , $ assoc_args ) { $ user = $ this -> fetcher -> get_check ( $ args [ 0 ] ) ; $ role = $ args [ 1 ] ; self :: validate_role ( $ role ) ; $ user -> add_role ( $ role ) ; WP_CLI :: success ( "Added '{$role}' role for {$user->user_login} ({$user->ID})." ) ; }
Adds a role for a user.

## OPTIONS

<user>
: User ID, user email, or user login.

<role>
: Add the specified role to the user.

## EXAMPLES

$ wp user add-role 12 author
Success: Added 'author' role for johndoe (12).

@subcommand add-role
Adds a role for a user .