Skip to content

I don't seem to have the latest version of db search after update to v2.11.0 #5969

@rosswintle

Description

@rosswintle

Bug Report

Describe the current, buggy behavior

After an update to wp-cli version 2.11.0 I do not seem to have the --format flag on the wp db search command.

I noticed that version 2.11.0 of WP-CLI included an update to the db search command to add a --format option.

I wanted to try this out, so I did wp cli update on my local machine, but I don't seem to have this new option.

I can replicate this by installing the latest wp-cli fresh and running wp help db search

$ wp cli version
WP-CLI 2.11.0

$ wp help db search

NAME

  wp db search

DESCRIPTION

  Finds a string in the database.

SYNOPSIS

  wp db search <search> [<tables>...] [--network] [--all-tables-with-prefix] [--all-tables] [--before_context=<num>]
  [--after_context=<num>] [--regex] [--regex-flags=<regex-flags>] [--regex-delimiter=<regex-delimiter>]
  [--table_column_once] [--one_line] [--matches_only] [--stats] [--table_column_color=<color_code>]
  [--id_color=<color_code>] [--match_color=<color_code>]

  Searches through all of the text columns in a selection of database tables for a given string, Outputs colorized
  references to the string.

  Defaults to searching through all tables registered to $wpdb. On multisite, this default is limited to the tables
  for the current site.

OPTIONS
...

Describe how other contributors can replicate this bug

  1. Create a new directory using mkdir wp-cli-test and enter it
  2. Install wp-cli: curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar
  3. Run php ./wp-cli/phar help db search
  4. You should not see the --format parameter
  5. Change directory to a WordPress installation
  6. Run php <directory>/wp-cli-test/wp-cli.phar db search --format
  7. You should see:
Error: Parameter errors:
 unknown --format parameter

Describe what you expect as the correct outcome

The db search command should have a --format option/parameter

Let us know what environment you are running this on

OS:	Darwin 23.5.0 Darwin Kernel Version 23.5.0: Wed May  1 20:16:51 PDT 2024; root:xnu-10063.121.3~5/RELEASE_ARM64_T8103 arm64
Shell:	/bin/zsh
PHP binary:	/opt/homebrew/Cellar/php@8.2/8.2.21/bin/php
PHP version:	8.2.21
php.ini used:	/opt/homebrew/etc/php/8.2/php.ini
MySQL binary:	/opt/homebrew/bin/mysql
MySQL version:	mysql  Ver 8.3.0 for macos14.2 on arm64 (Homebrew)
SQL modes:
WP-CLI root dir:	phar://wp-cli.phar/vendor/wp-cli/wp-cli
WP-CLI vendor dir:	phar://wp-cli.phar/vendor
WP_CLI phar path:	/Users/rosswintle/side-projects/rosswintle
WP-CLI packages dir:	/Users/rosswintle/.wp-cli/packages/
WP-CLI cache dir:	/Users/rosswintle/.wp-cli/cache
WP-CLI global config:	/Users/rosswintle/.wp-cli/config.yml
WP-CLI project config:
WP-CLI version:	2.11.0

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions