You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@felix.apache.org by gn...@apache.org on 2017/10/18 12:28:27 UTC

svn commit: r1812503 - /felix/trunk/gogo/jline/src/main/java/org/apache/felix/gogo/jline/Shell.java

Author: gnodet
Date: Wed Oct 18 12:28:27 2017
New Revision: 1812503

URL: http://svn.apache.org/viewvc?rev=1812503&view=rev
Log:
[FELIX-5651] Disable log history in Gogo console

Fixes #112

Modified:
    felix/trunk/gogo/jline/src/main/java/org/apache/felix/gogo/jline/Shell.java

Modified: felix/trunk/gogo/jline/src/main/java/org/apache/felix/gogo/jline/Shell.java
URL: http://svn.apache.org/viewvc/felix/trunk/gogo/jline/src/main/java/org/apache/felix/gogo/jline/Shell.java?rev=1812503&r1=1812502&r2=1812503&view=diff
==============================================================================
--- felix/trunk/gogo/jline/src/main/java/org/apache/felix/gogo/jline/Shell.java (original)
+++ felix/trunk/gogo/jline/src/main/java/org/apache/felix/gogo/jline/Shell.java Wed Oct 18 12:28:27 2017
@@ -244,6 +244,7 @@ public class Shell {
                 "Usage: gosh [OPTIONS] [script-file [args..]]",
                 "  -c --command             pass all remaining args to sub-shell",
                 "     --nointeractive       don't start interactive session",
+                "     --nohistory           don't save the command history",
                 "     --login               login shell (same session, reads etc/gosh_profile)",
                 "  -s --noshutdown          don't shutdown framework when script completes",
                 "  -x --xtrace              echo commands before execution",
@@ -287,7 +288,9 @@ public class Shell {
         session.put("#COLUMNS", (Function) (s, arguments) -> terminal.getWidth());
         session.put("#LINES", (Function) (s, arguments) -> terminal.getHeight());
         session.put("#PWD", (Function) (s, arguments) -> s.currentDir().toString());
-        session.put(LineReader.HISTORY_FILE, Paths.get(System.getProperty("user.home"), ".gogo.history"));
+        if (!opt.isSet("nohistory")) {
+            session.put(LineReader.HISTORY_FILE, Paths.get(System.getProperty("user.home"), ".gogo.history"));
+        }
 
         if (tio != null) {
             PrintWriter writer = terminal.writer();