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
When I try to run wp solr index via Terminus, I see this unexpected error:
$ terminus wp solr-demo-redux.dev "solr index"
[warning] This environment is in read-only Git mode. If you want to make changes to the codebase of this site (e.g. updating modules or plugins), you will need to toggle into read/write SFTP mode first.
Error: 'solr index' is not a registered wp command. See 'wp help'.
[notice] Command: solr-demo-redux.dev -- 'wp '\''solr index'\''' [Exit: 1]
[error]
When I run wp solr via Terminus, I see the expected result:
$ terminus wp solr-demo-redux.dev "solr"
[warning] This environment is in read-only Git mode. If you want to make changes to the codebase of this site (e.g. updating modules or plugins), you will need to toggle into read/write SFTP mode first.
usage: wp solr check-server-settings
or: wp solr delete [<id>...] [--all]
or: wp solr index [--posts_per_page] [--post_type]
or: wp solr info [--field=<field>] [--format=<format>]
or: wp solr optimize-index
or: wp solr repost-schema
or: wp solr stats [--field=<field>] [--format=<format>]
See 'wp help solr <command>' for more information on a specific command.
[notice] Command: solr-demo-redux.dev -- 'wp solr' [Exit: 0]
The nature of the original error message leads me to believe Terminus is incorrectly quoting WP-CLI subcommands.
If I run an incorrect WP-CLI subcommand, WP-CLI correctly interprets the parent as a valid command and the child as an invalid subcommand:
$ wp solr inde
Error: 'inde' is not a registered subcommand of 'solr'. See 'wp help solr'.
Therefore, Terminus must be calling wp 'solr index', which WP-CLI then interprets to be an invalid command.
The text was updated successfully, but these errors were encountered:
@danielbachhuber You are correct that using -- is the preferred syntax. Quoting is now used to pass a single parameter that contains spaces. This is a break from Terminus 0.x, and more in line with what other Symfony Console apps and other commandline tools use.
Terminus could, in fact, throw a helpful error message if the first parameter (the wp-cli command) contained a space. That's a good suggestion. Other parameters beyond the first may or may not contain spaces, though, so only the first parameter (after site.env) should be checked.
greg-1-anderson
changed the title
Terminus incorrectly quotes WP-CLI subcommands
Terminus could throw an error when old-style wp-cli / drush parameter quoting is used.
Jan 23, 2017
When I try to run
wp solr index
via Terminus, I see this unexpected error:When I run
wp solr
via Terminus, I see the expected result:The nature of the original error message leads me to believe Terminus is incorrectly quoting WP-CLI subcommands.
If I run an incorrect WP-CLI subcommand, WP-CLI correctly interprets the parent as a valid command and the child as an invalid subcommand:
Therefore, Terminus must be calling
wp 'solr index'
, which WP-CLI then interprets to be an invalid command.The text was updated successfully, but these errors were encountered: