Correct, thanks. Let me fix that.
Regards
JB
On 06/11/2012 03:10 PM, Guillaume Nodet wrote:
I think you should change the SCOPE session variable instead of
prefixing the commands.
It will allow using prefixed commands, else I fear your change will
forbid using grep inside a subshell for example.
On Mon, Jun 11, 2012 at 3:02 PM,<[email protected]> wrote:
Author: jbonofre
Date: Mon Jun 11 13:02:04 2012
New Revision: 1348828
URL: http://svn.apache.org/viewvc?rev=1348828&view=rev
Log:
[KARAF-647] Prefix commands with the corresponding scope
Modified:
karaf/trunk/shell/console/src/main/java/org/apache/karaf/shell/console/impl/jline/ConsoleImpl.java
Modified:
karaf/trunk/shell/console/src/main/java/org/apache/karaf/shell/console/impl/jline/ConsoleImpl.java
URL:
http://svn.apache.org/viewvc/karaf/trunk/shell/console/src/main/java/org/apache/karaf/shell/console/impl/jline/ConsoleImpl.java?rev=1348828&r1=1348827&r2=1348828&view=diff
==============================================================================
---
karaf/trunk/shell/console/src/main/java/org/apache/karaf/shell/console/impl/jline/ConsoleImpl.java
(original)
+++
karaf/trunk/shell/console/src/main/java/org/apache/karaf/shell/console/impl/jline/ConsoleImpl.java
Mon Jun 11 13:02:04 2012
@@ -246,11 +246,15 @@ public class ConsoleImpl implements Cons
} else {
command += " " + line;
}
- if (reader.getHistory().size()==0) {
- reader.getHistory().add(command);
- } else {
- reader.getHistory().replace(command);
- }
+ if (reader.getHistory().size()==0) {
+ reader.getHistory().add(command);
+ } else {
+ reader.getHistory().replace(command);
+ }
+ // append the subshell if present
+ if (session.get("SUBSHELL") != null&& ((String)
session.get("SUBSHELL")).trim().length()> 0&& !command.equals("exit")) {
+ command = session.get("SUBSHELL") + ":" + command;
+ }
try {
new Parser(command).program();
loop = false;
--
Jean-Baptiste Onofré
[email protected]
http://blog.nanthrax.net
Talend - http://www.talend.com