-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make the config command consistent by providing "list" and "get". #14
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 config
command more consistent with the way the rest of the commands behave, and to add needed functionality, I renamed the currentwp config get
command (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_prefix
to quickly get one particular value.