Bugzilla – Bug 851
Can't use parameters containing spaces in CLI
Last modified: 2008-12-18 11:53:54 UTC
This is a particular problem when trying to use the 'display' command after opening a TCP socket to port 9090 and e.g. typing display "hello word" "this is line 2" 30 the CLI just splits on the space, thus creating 7 arguments instead of 3. From Stdio.pm: # todo - allow for escaping and/or quoting my @params = split(" ", $command); One fix is to use 'shellwords.pl' - this should come with most perl distributions, or could just be copied into Stdio.pm - e.g. at the top of Stdio.pm: require 'shellwords.pl'; and replace the split with my @params = &shellwords($command); I haven't done any extensive testing of this, and don't know what else it may break.
Mike - I've checked in a fix for this as subversion change #2190
The CLI API expects URL ESCAPED parameters and not shell-like parameters. The particular example works if sending: display hello%20world this%20is%20line%202 30 Splitting on spaces AND url escaping work together to enable space in parameters. Changing this to accept shell like parameters break passing URLs to the CLI (<item> parameter in many CLI commands). URLs can contain \ and ', that break the shell-like parsing. IMHO the CLI is more a machine API than a human command line API. For the display case, it is trivial to create a simple perl script that does the transformation. I don't see any other command where a space could be needed in a parameter, and many commands expect a URL. I would therefore recommend to close this bug and leave the API as it stands; human convenient scripting can be easily achieved, such a script is described in bug 1140.
dan, this is probably your call at this point. This restriction is noted in the docs, but perhaps could be reiterated as part of the display command as I believe this is a more commonly used command for simple scripts, such as ones that make announcements.
Use URL escaping instead of quoting to get spaces, etc...
Routine bug db maintenance; removing old versions which cause confusion. I apologize for the inconvenience.