[GitHub] incubator-metron pull request #265: METRON-438: Back the Stellar REPL with a...

2016-09-21 Thread nickwallen
Github user nickwallen commented on a diff in the pull request:

https://github.com/apache/incubator-metron/pull/265#discussion_r79862290
  
--- Diff: 
metron-platform/metron-common/src/main/java/org/apache/metron/common/stellar/shell/StellarShell.java
 ---
@@ -244,6 +304,55 @@ private void write(String out) {
   }
 
   private void writeLine(String out) {
-System.out.println(out);
+console.getShell().out().println(out);
+  }
+
+  @Override
+  public int execute(ConsoleOperation output) throws InterruptedException {
+String expression = output.getBuffer().trim();
+if(StringUtils.isNotBlank(expression)) {
+  if(isMagic(expression)) {
+handleMagic( expression);
+
+  } else if(isDoc(expression)) {
+handleDoc(expression);
+
+  } else if (expression.equals("quit")) {
+try {
--- End diff --

Does this prevent the user from referring to a variable called `quit`?  If 
so, maybe `%quit`?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-metron pull request #265: METRON-438: Back the Stellar REPL with a...

2016-09-20 Thread cestella
GitHub user cestella opened a pull request:

https://github.com/apache/incubator-metron/pull/265

METRON-438: Back the Stellar REPL with a readline implementation

The REPL as it currently stands is great, but it could be closer in-line 
with the more popular REPL's by being backed by a readline implementation.
Specifically, we should:
* add variable assignment
* add loading a JSON document with variables from disk
* add the ability to do reverse searches in the history
* add the ability to use the arrow keys to recover previous inputs
* add the ability to adjust input via ~/.inputrc
* add autocomplete for function names and variable names

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/cestella/incubator-metron REPL_Extended

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/incubator-metron/pull/265.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #265


commit 4581b769c31c487d1b4469eb514a1bc96560b175
Author: cstella 
Date:   2016-09-21T01:55:32Z

Stellar REPL




---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---