karaf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gno...@apache.org
Subject [2/2] karaf git commit: [KARAF-5320] Karaf Command Arguments escapes backslash characters
Date Fri, 01 Sep 2017 09:45:46 GMT
[KARAF-5320] Karaf Command Arguments escapes backslash characters


Project: http://git-wip-us.apache.org/repos/asf/karaf/repo
Commit: http://git-wip-us.apache.org/repos/asf/karaf/commit/26418a67
Tree: http://git-wip-us.apache.org/repos/asf/karaf/tree/26418a67
Diff: http://git-wip-us.apache.org/repos/asf/karaf/diff/26418a67

Branch: refs/heads/karaf-4.1.x
Commit: 26418a67d3a6d529bd5ebd95f7f60a308f44ffd2
Parents: 1644d43
Author: Guillaume Nodet <gnodet@apache.org>
Authored: Fri Sep 1 10:53:10 2017 +0200
Committer: Guillaume Nodet <gnodet@apache.org>
Committed: Fri Sep 1 11:30:19 2017 +0200

----------------------------------------------------------------------
 .../karaf/shell/impl/console/ConsoleSessionImpl.java     | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/karaf/blob/26418a67/shell/core/src/main/java/org/apache/karaf/shell/impl/console/ConsoleSessionImpl.java
----------------------------------------------------------------------
diff --git a/shell/core/src/main/java/org/apache/karaf/shell/impl/console/ConsoleSessionImpl.java
b/shell/core/src/main/java/org/apache/karaf/shell/impl/console/ConsoleSessionImpl.java
index 6ab8ea8..1253967 100644
--- a/shell/core/src/main/java/org/apache/karaf/shell/impl/console/ConsoleSessionImpl.java
+++ b/shell/core/src/main/java/org/apache/karaf/shell/impl/console/ConsoleSessionImpl.java
@@ -36,6 +36,7 @@ import java.util.concurrent.atomic.AtomicBoolean;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 
+import org.apache.felix.gogo.jline.ParsedLineImpl;
 import org.apache.felix.gogo.jline.Shell;
 import org.apache.felix.gogo.runtime.CommandSessionImpl;
 import org.apache.felix.service.command.CommandProcessor;
@@ -341,10 +342,16 @@ public class ConsoleSessionImpl implements Session {
             String scriptFileName = System.getProperty(SHELL_INIT_SCRIPT);
             executeScript(scriptFileName);
             while (running) {
-                String command = null;
+                CharSequence command = null;
                 reading.set(true);
                 try {
-                    command = reader.readLine(getPrompt(), getRPrompt(), null, null);
+                    reader.readLine(getPrompt(), getRPrompt(), null, null);
+                    ParsedLine pl = reader.getParsedLine();
+                    if (pl instanceof ParsedLineImpl) {
+                        command = ((ParsedLineImpl) pl).program();
+                    } else {
+                        command = pl.line();
+                    }
                 } catch (EndOfFileException e) {
                     break;
                 } catch (UserInterruptException e) {


Mime
View raw message