Github user ottobackwards commented on a diff in the pull request:
https://github.com/apache/metron/pull/740#discussion_r137826193
--- Diff:
metron-stellar/stellar-common/src/main/java/org/apache/metron/stellar/common/shell/StellarShell.java
---
@@ -308,17 +315,68 @@ private void handleMagic( String rawExpression) {
.collect(Collectors.joining(", "));
writeLine(functions);
- } else if(MAGIC_VARS.equals(command)) {
+ } else if (MAGIC_VARS.equals(command)) {
- // list all variables
+ // '%vars' -> list all variables in scope
executor.getVariables()
- .forEach((k,v) -> writeLine(String.format("%s = %s", k, v)));
+ .forEach((k, v) -> writeLine(String.format("%s = %s", k,
v)));
+
+ } else if (MAGIC_GLOBALS.equals(command)) {
+
+ // '%globals' -> list all globals in scope
+ Map<String, Object> globals = Collections.emptyMap();
--- End diff --
I don't understand why we check for capabilities here, but not when
setting. It looks like I can define as much as I want, but only see if the
capability is there? Why do we only guard here?
---