ideas icon indicating copy to clipboard operation
ideas copied to clipboard

Standardize separator used in switches (- vs _)

Open catchmyfame opened this issue 7 years ago • 3 comments

Going through the various WP CLI commands and their switches/options, I noticed there's no standard in terms of word separators (_ vs -) for switches that have more than one word (not with regard to the initial --).

For example, these switches use a hyphen: --extra-php, --skip-salts, --admin-email, --skip-email

But these switches use an underscore: --post_id, --admin_user, --admin_password, --exclude_tables, --size_format.

It would be helpful if it was one or the other, and not both.

catchmyfame avatar Jan 29 '18 20:01 catchmyfame

Yes agree @catchmyfame it's an annoying inconsistency.

gitlost avatar Jan 29 '18 20:01 gitlost

The separator is generally -, and this is used pretty much consistently.

The switches you see that have an underscore are normally of the type: --<WordPress Field>=<value>. The underscore comes from the fact that these are mapped to existing WordPress fields/keys, which already contain the underscore.

schlessera avatar Jan 30 '18 06:01 schlessera

Previously https://github.com/wp-cli/wp-cli/issues/1122#issuecomment-159015640

danielbachhuber avatar Jan 31 '18 13:01 danielbachhuber