Make the config command consistent by providing "list" and "get".#14
Make the config command consistent by providing "list" and "get".#14schlessera wants to merge 1 commit intomasterfrom
Conversation
To make the `wp config` command more consistent with the way the rest of the commands behave, and to add needed functionality, I renamed the current `wp config get` command (which displays a list of all values) into `wp config list`, and added a new `wp config get <key>` command to retrieve the value of a specific key. This allows one to use something like `wp config get table_prefix` to quickly get one particular value.
|
👎 I patterned The established pattern is:
|
|
Well, the problem is that If you do There's no way to fetch a single value right now. |
|
Just try getting the |
|
Sure, it's not implemented yet. We could add this pattern: |
|
If you model it as described above, it is meant to manage a "collection of So, to compare posts vs configs... Your approach: My approach: |
"Not logical" is your opinion. If you consider Furthermore, and more importantly, my model is consistent with the rest of WP-CLI, meaning there's no mental overhead when using it.
This wouldn't work, because globals and constants can have the same name. You'd always need a |
|
I rather meant "not intuitive". I know a bit about WP-CLI, but I have spent 10 minutes trying to figure out how to get the |
|
Furthermore, we already have
Sure, let's add support for getting individual values. |
To make the
wp configcommand more consistent with the way the rest of the commands behave, and to add needed functionality, I renamed the currentwp config getcommand (which displays a list of all values) intowp config list, and added a newwp config get <key>command to retrieve the value of a specific key.This allows one to use something like
wp config get table_prefixto quickly get one particular value.