-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Quoting additional argument doesn't seem to work #21
Comments
You shouldn't need the quotes. It is designed to work without them.
|
@danielpataki did you resolve this issue? I'm facing the same right now. The command i want to run works perfectly fine on the remote server, but when i execute it from my local environment i get the "is not a registered wp command."-error if i add a paramter or try to quote the command to be used. In my case it happens when i add the --network parameter to the search-replace command. Trying to change the host used on a wpmu network.
This works fine. But it will only affect the main site.
This will not work. It complains that --network is a unknown parameter.
This should work accordingly to the documentation. But it dosen't. For me it looks like wp-cli-ssh dosen't work with quotes anymore. And the quotes will be needed if you want to add parameters to the remote command? |
Hi there @davidallansson, Sorry to @westonruter, I didn't notice his answer. I can't really try this out just now but I don't remember figuring it out. Since I can't try it out now I can't say but I get the feeling it wont work without quotes. Daniel |
This definitely does not work right now, just like the OP says
|
Anybody here have any idea about how to go about debugging this? Secondary parameters not working are essentially killing all ability to |
@lkraav I think I found the little issue. Please test my pull request and tell me if it works for you. A little tweak in the synopsis was all it tooks. Sorry it took me so long to get to it! |
It worksssssssss. Ty sir! Probably not fully on topic here, but is bash-completion not supposed to work for |
The nature of the plugin makes it difficult to have bash completion since we are proxying the request to somewhere else. Would be a good improvement though 😉 |
Yeah, Bash completion would really only be feasible if we were able to figure out #15, caching an SSH connection to speed up calls. |
I'd just like to raise that this issue is still a problem, doing some digging in xDebug, it originally stems from the way you are accessing arguments at the beginning of The loop of foreach ( array_slice( $GLOBALS['argv'], 2 ) as $arg ) {} will result in an array like $cli_args = [
0 => 'search-replace foo bar --skip-tables'
]; where as the desired outcome would be $cli_args = [
0 => 'search-replace',
1 => 'foo',
2 => 'bar',
3 => '--skip-tables'
]; While the commands do get concatenated back together as a string later, this incorrect grouping means that the call to I'm evaluating a few different options to fix, I'll submit a PR for review when done. Originally I tried just exploding the string on spaces, and it worked for my particular use case - but there will be some commands that will have 'legitimate' spaces inside quotes so a regexp solution is looking likely. My first attempt worked but has one too many layers of |
I'm sure this is an error on my end since this would have been reported by now, but it seems I am unable to add parameters to a command. I would like to force install a theme which I am doing like this:
The command produces the following error, as if the whole quoted string was the command name:
Error: 'theme install wp-content/themes/bitesizebio.zip --force' is not a registered wp command. See 'wp help'.
I tested the command on the server without wp-cli-ssh and
theme install wp-content/themes/theme.zip --force
works just fine. In addition, commands without parameters fail with the same error, eg:wp ssh 'plugin list' --host=staging
I am using the latest version of wp-cli-ssh and wp-cli itself.
Thanks so much for this awesome tool!
The text was updated successfully, but these errors were encountered: