Given an empty directory
And WP files
- When I try `wp core config invalid`
+ When I try `wp core config`
Then the return code should be 1
And STDERR should contain:
"""
Parameter errors:
"""
+ And STDERR should contain:
+ """
+ missing --dbname parameter
+ """
- When I try `wp core config invalid --invalid --other-invalid`
+ When I try `wp core config --invalid --other-invalid`
Then the return code should be 1
And STDERR should contain:
"""
"""
unknown --other-invalid parameter
"""
+
+ When I try `wp core version invalid`
+ Then the return code should be 1
+ And STDERR should contain:
+ """
+ Error: Too many positional arguments: invalid
+ """
+ And STDOUT should be empty
$unknown_positionals = $validator->unknown_positionals( $args );
if ( !empty( $unknown_positionals ) ) {
- \WP_CLI::warning( 'Too many positional arguments: ' .
+ \WP_CLI::error( 'Too many positional arguments: ' .
implode( ' ', $unknown_positionals ) );
}