Skip to content

Conversation

Copy link

Copilot AI commented Jan 12, 2026

The --quiet flag was not suppressing mysqlcheck output for wp db check, wp db optimize, and wp db repair commands. Users still saw table names and progress information despite using --quiet.

Changes

  • check(), optimize(), repair() methods: Added detection of WP_CLI::get_config('quiet') to automatically pass --silent to mysqlcheck when quiet mode is active
// Pass --silent to mysqlcheck when in quiet mode.
if ( WP_CLI::get_config( 'quiet' ) ) {
    $assoc_args['silent'] = true;
}
  • features/db-quiet.feature: Added test coverage for quiet mode behavior across all three commands

Behavior

Before:

$ wp db optimize --quiet
wp_cli_test.wp_options
note     : Table does not support optimize...
wp_cli_test.wp_users
...

After:

$ wp db optimize --quiet
# (silent - only errors shown if they occur)

Users can still pass --silent explicitly to mysqlcheck if needed. Normal verbose output is preserved when --quiet is not used.

Original prompt

This section details on the original issue you should resolve

<issue_title>--quiet option not working for wp db optimize and wp db repair</issue_title>
<issue_description>Hi,

I tried to run

wp db optimize --quiet
and

wp db repair --quiet
but they both produce informational messages.</issue_description>

Comments on the Issue (you are @copilot in this section)

@swissspidy These commands just call `mysqlcheck`, which supports a `--silent` flag to only print error messages, so you could pass that one.

What we could do in addition is to check WP_CLI::get_config( 'quiet' ) and then pass --silent automatically. This would apply to the check, optimize and repair commands.</comment_new>


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix --quiet option for wp db optimize and wp db repair Add automatic --silent flag to mysqlcheck commands when --quiet is set Jan 12, 2026
Copilot AI requested a review from swissspidy January 12, 2026 10:29
@swissspidy swissspidy requested a review from Copilot January 12, 2026 11:13

This comment was marked as resolved.

@swissspidy

This comment was marked as resolved.

gemini-code-assist[bot]

This comment was marked as resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

--quiet option not working for wp db optimize and wp db repair

2 participants