You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@jclouds.apache.org by Ignasi Barrera <no...@github.com> on 2016/11/02 13:02:24 UTC

Re: [jclouds/jclouds-cli] JCLOUDS-1189: Handle arguments with spaces (#34)

nacx 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("\"");

Given [this comment](http://karaf.922171.n3.nabble.com/Karaf-shell-command-argument-with-space-td4027039.html#a4027040) I assume arguments with spaces in karaf need to be quoted. The problem is just how we "pass" those quotes from our runner script to the Main class, to then build the proper karaf command.
Given the link above (despite not being a karaf expert), I'd say this approach is OK.

-- 
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