Skip to content

5677 cross platform alias syntax#5678

Closed
timotheemoulin wants to merge 9888 commits intowp-cli:masterfrom
timotheemoulin:5677-cross-platform-alias-syntax
Closed

5677 cross platform alias syntax#5678
timotheemoulin wants to merge 9888 commits intowp-cli:masterfrom
timotheemoulin:5677-cross-platform-alias-syntax

Conversation

@timotheemoulin
Copy link
Copy Markdown

  • Add a new aliases configuration entry in the wp-cli.yml file
  • Allow to use --alias=foo instead of @foo to use an alias
  • Keep the classic arg notation working
  • Works properly with the local and global configs merged together even if both styles are used

New wp-cli.yml config entry aliases

Example of a working configuration.

Global config file

@test-1:
  ssh: user@domain-test.com:~/web

Local config file

@test-2:
  ssh: user@domain-test-2.com
  path: ~/web

aliases:
  test-3:
    ssh: user@domain-test-3.com
  @test-4:
    ssh: user@domain-test-4.com

When using the aliases config entry, there is no need to prefix the alias name with @. Every key in this hash is recognized as a valid alias name.

@all and other group features seem to be working properly (though I never had them working on Windows due sur sub-PHP process command not knowing where to find the ssh command).

New CLI parameter --alias

Instead of using the @alias positional parameter, you can now use the --alias=foo param.
This improves the Windows CLI compatibility as @ is a reserved char (like $ or `) and need to be quoted to work properly.

--alias= param works well with both classic alias definition and the new. And it works exactly the same for groups.

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.