php/commands/src/CLI_Command.php
public function check_update( $_, $assoc_args ) {
		$updates = $this->get_updates( $assoc_args );

		if ( $updates ) {
			$formatter = new \WP_CLI\Formatter(
				$assoc_args,
				array( 'version', 'update_type', 'package_url' )
			);
			$formatter->display_items( $updates );
		} elseif ( empty( $assoc_args['format'] ) || 'table' === $assoc_args['format'] ) {
			$update_type = $this->get_update_type_str( $assoc_args );
			WP_CLI::success( "WP-CLI is at the latest{$update_type}version." );
		}
	}
public function check_update( $_, $assoc_args ) {
		$updates = $this->get_updates( $assoc_args );

		if ( $updates ) {
			$formatter = new \WP_CLI\Formatter(
				$assoc_args,
				array( 'version', 'update_type', 'package_url' )
			);
			$formatter->display_items( $updates );
		} elseif ( empty( $assoc_args['format'] ) || 'table' === $assoc_args['format'] ) {
			$update_type = $this->get_update_type_str( $assoc_args );
			WP_CLI::success( "WP-CLI is at the latest{$update_type}version." );
		}
	}
public function check_update ( $ _ , $ assoc_args ) { $ updates = $ this -> get_updates ( $ assoc_args ) ; if ( $ updates ) { $ formatter = new \ WP_CLI \ Formatter ( $ assoc_args , array ( 'version' , 'update_type' , 'package_url' ) ) ; $ formatter -> display_items ( $ updates ) ; } elseif ( empty ( $ assoc_args [ 'format' ] ) || 'table' === $ assoc_args [ 'format' ] ) { $ update_type = $ this -> get_update_type_str ( $ assoc_args ) ; WP_CLI :: success ( "WP-CLI is at the latest{$update_type}version." ) ; } }
Check to see if there is a newer version of WP-CLI available.

Queries the Github releases API. Returns available versions if there are
updates available, or success message if using the latest release.

## OPTIONS

[--patch]
: Only list patch updates.

[--minor]
: Only list minor updates.

[--major]
: Only list major updates.

[--field=<field>]
: Prints the value of a single field for each update.

[--fields=<fields>]
: Limit the output to specific object fields. Defaults to version,update_type,package_url.

[--format=<format>]
: Render output in a particular format.
---
default: table
options:
- table
- csv
- json
- count
- yaml
---

## EXAMPLES

# Check for update.
$ wp cli check-update
Success: WP-CLI is at the latest version.

# Check for update and new version is available.
$ wp cli check-update
+---------+-------------+-------------------------------------------------------------------------------+
| version | update_type | package_url                                                                   |
+---------+-------------+-------------------------------------------------------------------------------+
| 0.24.1  | patch       | https://github.com/wp-cli/wp-cli/releases/download/v0.24.1/wp-cli-0.24.1.phar |
+---------+-------------+-------------------------------------------------------------------------------+

@subcommand check-update
Check to see if there is a newer version of WP - CLI available .