src/Command.php
/**
     * Display the list of registered packages
     *
     * ## OPTIONS
     *
     * [--format=<format>]
     *
     * @subcommand list
     */
Display the list of registered packages
OPTIONS



@subcommand list
Display the list of registered packages OPTIONS @subcommand list
public function showList($args, $assoc_args)
    {
        $format = empty($assoc_args['format']) ? 'table' : trim($assoc_args['format']);
        switch ($format) {
            case 'table':
            case 'json':
            case 'csv':
            case 'yaml':
            case 'count':
                break;
            default:
                WP_CLI::error('Invalid format');
        }
        $items = [];
        foreach (self::$migrators as $slug => $migrator) {
            $status = $this->getStatus($slug);
            if ($status !== false) {
                $items[] = [
                    'slug' => $slug,
                    'type' => $migrator->getPackageType(),
                    'status' => $status,
                    'current' => $migrator->current(),
                ];
            }
        }
        $fields = [
            'slug',
            'type',
            'status',
            'current',
        ];
        WP_CLI\Utils\format_items($format, $items, $fields);
    }
public function showList ( $ args , $ assoc_args ) { $ format = empty ( $ assoc_args [ 'format' ] ) ? 'table' : trim ( $ assoc_args [ 'format' ] ) ; switch ( $ format ) { case 'table' : case 'json' : case 'csv' : case 'yaml' : case 'count' : break ; default : WP_CLI :: error ( 'Invalid format' ) ; } $ items = [ ] ; foreach ( self :: $ migrators as $ slug => $ migrator ) { $ status = $ this -> getStatus ( $ slug ) ; if ( $ status !== false ) { $ items [ ] = [ 'slug' => $ slug , 'type' => $ migrator -> getPackageType ( ) , 'status' => $ status , 'current' => $ migrator -> current ( ) , ] ; } } $ fields = [ 'slug' , 'type' , 'status' , 'current' , ] ; WP_CLI \ Utils \ format_items ( $ format , $ items , $ fields ) ; }
Display the list of registered packages
 ## OPTIONS
Display the list of registered packages ## OPTIONS