You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thanks for the idea from @schlessera with this parameter.
Sadly I have no much experience with PHP since ~ 3.5 anymore and fight more last years with saltstack/jinja2/python and it's different kinds of problems/bugs to setup servers.
The call as @BhargavBhandari90 mentioned didn't work nicely (already tested it before opening this issue) because it shows only defined units and not the best human readable one (2,2GB in kB are also not good "human readable").
changed the title [-]Future Request/idea: setup additional size_format to h / human readable[/-][+]Add `--human-readable` flag to `db size`[/+]on Nov 17, 2018
@kingkero In command-line lingo, "human-readable" means that the numbers are adapted to their nearest biggest unit, to avoid big unwielding numbers when the unit is too small.
@kingkero It cannot be the default, it has not been implemented yet. Are you sure you don't just have a custom --size set up in your global config file?
@schlessera Don't have a global or local config. I was actually still using WP-CLI v1.3.0 on my local machine. Just updated to v2.0.1, now the output is in Bytes similar to Reiner's original output.
Activity
BhargavBhandari90 commentedon Oct 7, 2018
@Reiner030
I think you can do this with
wp db size --format=csv --tables --size_format=kbYou can use
kbormbas a size_formatschlessera commentedon Oct 24, 2018
@Reiner030 I'm open to adding this. Are you able and willing to provide a corresponding pull request?
I think the flag should be
--human-readable. People can then add this flag to their global WP-CLI config if they want to use it as default.Reiner030 commentedon Nov 17, 2018
Thanks for the idea from @schlessera with this parameter.
Sadly I have no much experience with PHP since ~ 3.5 anymore and fight more last years with saltstack/jinja2/python and it's different kinds of problems/bugs to setup servers.
The call as @BhargavBhandari90 mentioned didn't work nicely (already tested it before opening this issue) because it shows only defined units and not the best human readable one (2,2GB in kB are also not good "human readable").
schlessera commentedon Nov 17, 2018
@Reiner030 No worries, I'm sure something will be interested in picking this up.
[-]Future Request/idea: setup additional size_format to h / human readable[/-][+]Add `--human-readable` flag to `db size`[/+]kingkero commentedon Nov 25, 2018
Does this depend on the environment? For me, it prints the size in human readable format by default
Config:
schlessera commentedon Nov 28, 2018
@kingkero In command-line lingo, "human-readable" means that the numbers are adapted to their nearest biggest unit, to avoid big unwielding numbers when the unit is too small.
As an example:
kingkero commentedon Nov 28, 2018
@schlessera I understand. I just wanted to add that on my system this is the default behaviour, whereas on Reiner's it seems not to be.
wp_options,"1 MB"(mine)instead of
wp_options,"4751360 B"(his)schlessera commentedon Nov 28, 2018
@kingkero It cannot be the default, it has not been implemented yet. Are you sure you don't just have a custom
--sizeset up in your global config file?kingkero commentedon Dec 4, 2018
@schlessera Don't have a global or local config. I was actually still using WP-CLI v1.3.0 on my local machine. Just updated to v2.0.1, now the output is in Bytes similar to Reiner's original output.
schlessera commentedon Dec 17, 2018
Fixed via #124