src/WPametu/Utility/WPametuCommand.php
public function assets( $args, $assoc_args ) {
		list( $type ) = $args;
		$global = self::get_flag( 'global', $assoc_args );
		if ( false === array_search( $type, [ 'css', 'js' ] ) ) {
			self::e( $this->__( 'Only css and js are supported.' ) );
		}
		$header = [
			'Handle',
			'Source',
			'Dependency',
			'Version',
			'css' === $type ? 'Media' : 'Footer',
		];
		$rows   = [];
		if ( $global ) {
			switch ( $type ) {
				case 'js':

					break;
				case 'css':

					break;
				default:
					// Do nothing
					break;
			}
		} else {
			$assets = Library::all_assets()[ $type ];
			foreach ( $assets as $handle => $asset ) {
				$rows[] = array_merge( [ $handle ], array_map( function ( $var ) {
					if ( is_bool( $var ) ) {
						return $var ? 'Yes' : 'No';
					} elseif ( is_array( $var ) ) {
						return empty( $var ) ? '-' : implode( ', ', $var );
					} elseif ( is_null( $var ) ) {
						return '-';
					} else {
						return $var;
					}
				}, $asset ) );
			}
		}

		self::table( $header, $rows );
		self::l( '' );
		self::s( sprintf( '%d %s are available on WPametu.', count( $rows ), $type ) );
	}
public function assets( $args, $assoc_args ) {
		list( $type ) = $args;
		$global = self::get_flag( 'global', $assoc_args );
		if ( false === array_search( $type, [ 'css', 'js' ] ) ) {
			self::e( $this->__( 'Only css and js are supported.' ) );
		}
		$header = [
			'Handle',
			'Source',
			'Dependency',
			'Version',
			'css' === $type ? 'Media' : 'Footer',
		];
		$rows   = [];
		if ( $global ) {
			switch ( $type ) {
				case 'js':

					break;
				case 'css':

					break;
				default:
					// Do nothing
					break;
			}
		} else {
			$assets = Library::all_assets()[ $type ];
			foreach ( $assets as $handle => $asset ) {
				$rows[] = array_merge( [ $handle ], array_map( function ( $var ) {
					if ( is_bool( $var ) ) {
						return $var ? 'Yes' : 'No';
					} elseif ( is_array( $var ) ) {
						return empty( $var ) ? '-' : implode( ', ', $var );
					} elseif ( is_null( $var ) ) {
						return '-';
					} else {
						return $var;
					}
				}, $asset ) );
			}
		}

		self::table( $header, $rows );
		self::l( '' );
		self::s( sprintf( '%d %s are available on WPametu.', count( $rows ), $type ) );
	}
public function assets ( $ args , $ assoc_args ) { list ( $ type ) = $ args ; $ global = self :: get_flag ( 'global' , $ assoc_args ) ; if ( false === array_search ( $ type , [ 'css' , 'js' ] ) ) { self :: e ( $ this -> __ ( 'Only css and js are supported.' ) ) ; } $ header = [ 'Handle' , 'Source' , 'Dependency' , 'Version' , 'css' === $ type ? 'Media' : 'Footer' , ] ; $ rows = [ ] ; if ( $ global ) { switch ( $ type ) { case 'js' : break ; case 'css' : break ; default : // Do nothing break ; } } else { $ assets = Library :: all_assets ( ) [ $ type ] ; foreach ( $ assets as $ handle => $ asset ) { $ rows [ ] = array_merge ( [ $ handle ] , array_map ( function ( $ var ) { if ( is_bool ( $ var ) ) { return $ var ? 'Yes' : 'No' ; } elseif ( is_array ( $ var ) ) { return empty ( $ var ) ? '-' : implode ( ', ' , $ var ) ; } elseif ( is_null ( $ var ) ) { return '-' ; } else { return $ var ; } } , $ asset ) ) ; } } self :: table ( $ header , $ rows ) ; self :: l ( '' ) ; self :: s ( sprintf ( '%d %s are available on WPametu.' , count ( $ rows ) , $ type ) ) ; }
Show all asset libraries of WPametu

## OPTIONS

<type>
: Assets type. 'css', 'js' are supported.

[--global]
: Show global assets registered without WPametu

## EXAMPLES

wp ametu assets css

@synopsis <type> [--global]
Show all asset libraries of WPametu