You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tinkerpop.apache.org by sp...@apache.org on 2016/08/26 20:25:18 UTC

[11/18] tinkerpop git commit: fixed bug where :set didn't allow spaces. but what else did it break???

fixed bug where :set didn't allow spaces.  but what else did it break???


Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/5bd11526
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/5bd11526
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/5bd11526

Branch: refs/heads/master
Commit: 5bd115266ef7a27abf1a34547fca720ad46c115e
Parents: 72a54f5
Author: Robert Dale <ro...@gmail.com>
Authored: Fri Aug 19 18:10:57 2016 -0400
Committer: Robert Dale <ro...@gmail.com>
Committed: Fri Aug 19 18:10:57 2016 -0400

----------------------------------------------------------------------
 docs/src/reference/gremlin-applications.asciidoc          |  2 +-
 .../tinkerpop/gremlin/console/GremlinGroovysh.groovy      | 10 ++++++----
 2 files changed, 7 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/5bd11526/docs/src/reference/gremlin-applications.asciidoc
----------------------------------------------------------------------
diff --git a/docs/src/reference/gremlin-applications.asciidoc b/docs/src/reference/gremlin-applications.asciidoc
index b138e6c..7074fb9 100644
--- a/docs/src/reference/gremlin-applications.asciidoc
+++ b/docs/src/reference/gremlin-applications.asciidoc
@@ -153,7 +153,7 @@ some other useful operations.  The following table outlines the most commonly us
 Console Preferences
 ~~~~~~~~~~~~~~~~~~~
 
-Preferences are set with `:set name value`.  Value can not contain spaces. Preferences are removed by `:purge preferences`
+Preferences are set with `:set name value`.  Values can contain spaces when quoted. Preferences are removed by `:purge preferences`
 
 [width="100%",cols="3,^2,10",options="header"]
 |=========================================================

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/5bd11526/gremlin-console/src/main/groovy/org/apache/tinkerpop/gremlin/console/GremlinGroovysh.groovy
----------------------------------------------------------------------
diff --git a/gremlin-console/src/main/groovy/org/apache/tinkerpop/gremlin/console/GremlinGroovysh.groovy b/gremlin-console/src/main/groovy/org/apache/tinkerpop/gremlin/console/GremlinGroovysh.groovy
index 31a8ba8..fdf799a 100644
--- a/gremlin-console/src/main/groovy/org/apache/tinkerpop/gremlin/console/GremlinGroovysh.groovy
+++ b/gremlin-console/src/main/groovy/org/apache/tinkerpop/gremlin/console/GremlinGroovysh.groovy
@@ -22,6 +22,7 @@ import org.codehaus.groovy.tools.shell.Command
 import org.codehaus.groovy.tools.shell.Groovysh
 import org.codehaus.groovy.tools.shell.ParseCode
 import org.codehaus.groovy.tools.shell.Parser
+import org.codehaus.groovy.tools.shell.util.CommandArgumentParser
 
 /**
  * Overrides the posix style parsing of Groovysh allowing for commands to parse prior to Groovy 2.4.x.
@@ -45,12 +46,13 @@ class GremlinGroovysh extends Groovysh {
     Command findCommand(final String line, final List<String> parsedArgs = null) {
         def l = line ?: ""
 
-        final List<String> args = parseLine(l)
-        if (args.size() == 0) return null
+        final List<String> linetokens = parseLine(l)
+        if (linetokens.size() == 0) return null
 
-        def cmd = registry.find(args[0])
+        def cmd = registry.find(linetokens[0])
 
-        if (cmd != null && args.size() > 1 && parsedArgs != null) {
+        if (cmd != null && linetokens.size() > 1 && parsedArgs != null) {
+            List<String> args = CommandArgumentParser.parseLine(line, parsedArgs == null ? 1 : -1)
             parsedArgs.addAll(args[1..-1])
         }