You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@karaf.apache.org by Guillaume Nodet <gn...@gmail.com> on 2012/06/11 15:10:09 UTC
Re: svn commit: r1348828 - /karaf/trunk/shell/console/src/main/java/org/apache/karaf/shell/console/impl/jline/ConsoleImpl.java
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, <jb...@apache.org> 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;
>
>
--
------------------------
Guillaume Nodet
------------------------
Blog: http://gnodet.blogspot.com/
------------------------
FuseSource, Integration everywhere
http://fusesource.com
Re: svn commit: r1348828 - /karaf/trunk/shell/console/src/main/java/org/apache/karaf/shell/console/impl/jline/ConsoleImpl.java
Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
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,<jb...@apache.org> 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é
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com