mranney/node_redis — pull request #181 by thauburger (2012-03-04 12:28:11+00:00)
Title: send_command() patch

Added support for space-delimited commands (e.g.`DEBUG OBJECT`) by treating each word in the command as its own 'element' in the multi-bulk request. Prior to this change, send_command() failed to execute the 5 redis commands consisting of more than one word:

* `CONFIG GET`
* `CONFIG SET`
* `CONFIG RESETSTAT`
* `DEBUG OBJECT`
* `DEBUG SEGFAULT`

If we take the `DEBUG OBJECT` example:

The old approach bundled the command as a single element in the multi-bulk request:

````
*2
$12
DEBUG OBJECT
$7
testkey

````
This resulted in Redis returning the error: " ERR unknown command 'debug object' ".

The patched approach first parses the command string for multiple words, and then gives each word its own element in the request:

````
*3
$5
DEBUG
$6
OBJECT
$7
testkey
````
This results in improved coverage of commands supported by `send_command()`, and provides future-proofing for new Redis commands consisting of multiple words.