src/Super_Admin_Command.php
public function list_subcommand( $_, $assoc_args ) {
		$super_admins = self::get_admins();

		if ( 'list' === $assoc_args['format'] ) {
			foreach ( $super_admins as $user_login ) {
				WP_CLI::line( $user_login );
			}
		} else {
			$output_users = array();
			foreach ( $super_admins as $user_login ) {
				$output_user = new stdClass();

				$output_user->user_login = $user_login;

				$output_users[] = $output_user;
			}
			$formatter = new \WP_CLI\Formatter( $assoc_args, $this->fields );
			$formatter->display_items( $output_users );
		}
	}
public function list_subcommand( $_, $assoc_args ) {
		$super_admins = self::get_admins();

		if ( 'list' === $assoc_args['format'] ) {
			foreach ( $super_admins as $user_login ) {
				WP_CLI::line( $user_login );
			}
		} else {
			$output_users = array();
			foreach ( $super_admins as $user_login ) {
				$output_user = new stdClass();

				$output_user->user_login = $user_login;

				$output_users[] = $output_user;
			}
			$formatter = new \WP_CLI\Formatter( $assoc_args, $this->fields );
			$formatter->display_items( $output_users );
		}
	}
public function list_subcommand ( $ _ , $ assoc_args ) { $ super_admins = self :: get_admins ( ) ; if ( 'list' === $ assoc_args [ 'format' ] ) { foreach ( $ super_admins as $ user_login ) { WP_CLI :: line ( $ user_login ) ; } } else { $ output_users = array ( ) ; foreach ( $ super_admins as $ user_login ) { $ output_user = new stdClass ( ) ; $ output_user -> user_login = $ user_login ; $ output_users [ ] = $ output_user ; } $ formatter = new \ WP_CLI \ Formatter ( $ assoc_args , $ this -> fields ) ; $ formatter -> display_items ( $ output_users ) ; } }
Lists users with super admin capabilities.

## OPTIONS

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

## EXAMPLES

# List user with super-admin capabilities
$ wp super-admin list
supervisor
administrator

@subcommand list
Lists users with super admin capabilities .