jclouds-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrew Gaul <notificati...@github.com>
Subject Re: [jclouds/jclouds-cli] JCLOUDS-1189: Handle arguments with spaces (#34)
Date Wed, 02 Nov 2016 22:09:05 GMT
andrewgaul commented on this pull request.



> @@ -254,7 +254,12 @@ private void run(final CommandProcessorImpl commandProcessor, String[]
args, fin
                 if (i > 0) {
                     sb.append(" ");
                 }
-                sb.append(args[i]);
+                if (args[i].contains(" ")) {
+                    // quote arguments with spaces
+                    sb.append("\"").append(args[i]).append("\"");

I tested quote handling with 1.9.1 and 2.0.0 with this commit:

```
$ bin/jclouds-cli-1.9.1/bin/jclouds blobstore read $CONTAINER '"' out
IO error: unexpected EOT looking for matching quote: "

$ bin/jclouds-cli-1.9.1/bin/jclouds blobstore read $CONTAINER 'foo "bar"' out
Error executing command jclouds:blobstore-read: too many arguments specified
```

```
$ bin/jclouds-cli-2.0.0-SNAPSHOT/bin/jclouds blobstore read $CONTAINER '"' out
IO error: unexpected EOT looking for matching quote: "

$ bin/jclouds-cli-2.0.0-SNAPSHOT/bin/jclouds blobstore read $CONTAINER 'foo "bar"' out
Blob not found: foo bar not found in container gaulovrclk-us-east-1: while getting blob
```

Karaf eats the quotes but we do not regress the behavior.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-cli/pull/34
Mime
View raw message