Skip to content

Treat @[A-Za-z0-9-_]+ defined in yml config as an alias#2974

Merged
danielbachhuber merged 5 commits into
masterfrom
2039-alias-prototype
Jun 6, 2016
Merged

Treat @[A-Za-z0-9-_]+ defined in yml config as an alias#2974
danielbachhuber merged 5 commits into
masterfrom
2039-alias-prototype

Conversation

@danielbachhuber
Copy link
Copy Markdown
Member

@danielbachhuber danielbachhuber commented Jun 6, 2016

Aliases are a way of defining a shorthand reference to a WordPress install.

One or more aliases can be defined in config.yml or wp-cli.yml:

@wpdev:
  path: /srv/www/wordpress-develop.dev/src

An alias is called as the first argument to the wp executable:

salty-wordpress ➜  .wp-cli  wp @wpdev option get home
http://wordpress-develop.dev

The matching alias will overload the global parameters it defines. When an alias is used, any passed arguments will be treated as local parameters:

salty-wordpress ➜  .wp-cli  wp @wpdev option get home --path=/srv/www/wordpress-develop.dev/src
Error: Parameter errors:
 unknown --path parameter

This last implementation detail provides a path forward for solving #1222 without breaking backwards compat.

See #2039

More than one named alias can be registered. The matching alias will
overload the global parameters it defines.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant