Skip to content

Invalid output for status command when using format option #23

@ssnepenthe

Description

@ssnepenthe

There are two parts to this... When running wp vuln status --format=json:

  1. The headers are still being printed (WordPress %%VERSION%%, Plugins, Themes, Nothing to update).
  2. Output is presented as three separate JSON encoded arrays.

Because of this you cannot easily reuse the output from this command:

public function test( $args, $assoc_args ) {
    $parsed = WP_CLI::runcommand( 'vuln status --format=json', [
        'return' => true,
        'parse' => 'json',
    ] );

    var_dump( $parsed ); // NULL
}

The same goes for all other allowed formats.

Not sure if this is important to you or not but I thought I should point it out since this seems like it would be the main use for these alternative output formats.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions