Accept plaintext as an alias of var_export in cli param-dump#6339
Open
thisismyurl wants to merge 1 commit into
Open
Accept plaintext as an alias of var_export in cli param-dump#6339thisismyurl wants to merge 1 commit into
plaintext as an alias of var_export in cli param-dump#6339thisismyurl wants to merge 1 commit into
Conversation
`plaintext` and `var_export` are the same plain-text output format under two names across WP-CLI commands. `cli param-dump` only honored `var_export`, so `--format=plaintext` silently fell through to JSON. Accept both names (and list `plaintext` in the documented options) so the format is consistent with the single-value formatters, which already alias the two. Adds a functional test asserting `--format=plaintext` emits the var_export representation. Refs wp-cli#4774
Contributor
|
Hello! 👋 Thanks for opening this pull request! Please check out our contributing guidelines. We appreciate you taking the initiative to contribute to this project. Contributing isn't limited to just code. We encourage you to contribute in the way that best fits your abilities, by writing tutorials, giving a demo at your local meetup, helping other users with their support questions, or revising our documentation. Here are some useful Composer commands to get you started:
To run a single Behat test, you can use the following command: # Run all tests in a single file
composer behat features/some-feature.feature
# Run only a specific scenario (where 123 is the line number of the "Scenario:" title)
composer behat features/some-feature.feature:123You can find a list of all available Behat steps in our handbook. |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
plaintextandvar_exportare two names for the same plain-text output format across WP-CLI. The single-value formatters already register both names to the same handler, butcli param-dumpdoes its ownvar_export( $spec )and only checked for--format=var_export, so--format=plaintextsilently fell through to JSON.This accepts both names in
param-dumpand listsplaintextin the command's documented--formatoptions, matching the suggestion on #4774 to accept both wherever that format is used. It is backward compatible:var_exportkeeps working andplaintextnow works too.To verify:
wp cli param-dump --format=plaintextnow emits the PHPvar_exportrepresentation (e.g.'path' =>) rather than JSON. A functional test infeatures/cli.featurecovers it.Refs #4774
(full disclosure: AI helped me identify the issue and verify my work)