|
From: <cr...@us...> - 2009-06-08 07:34:53
|
Revision: 5560
http://jnode.svn.sourceforge.net/jnode/?rev=5560&view=rev
Author: crawley
Date: 2009-06-08 07:34:35 +0000 (Mon, 08 Jun 2009)
Log Message:
-----------
First argument of a command wasn't included in initial completions;
e.g. completing "dir " didn't include any pathnames in the completion set.
Modified Paths:
--------------
trunk/shell/src/shell/org/jnode/shell/bjorne/BjorneCompleter.java
trunk/shell/src/test/org/jnode/test/shell/bjorne/BjorneCompletionTest.java
Modified: trunk/shell/src/shell/org/jnode/shell/bjorne/BjorneCompleter.java
===================================================================
--- trunk/shell/src/shell/org/jnode/shell/bjorne/BjorneCompleter.java 2009-06-08 07:16:12 UTC (rev 5559)
+++ trunk/shell/src/shell/org/jnode/shell/bjorne/BjorneCompleter.java 2009-06-08 07:34:35 UTC (rev 5560)
@@ -63,6 +63,8 @@
if (words.length > 1 && words[words.length - 1] == penultimateToken) {
boolean argumentAnticipated = penultimateToken.end < endToken.end;
command.complete(completion, context, shell, argumentAnticipated);
+ } else if (words.length == 1 && words[0] == penultimateToken && penultimateToken.end < endToken.end) {
+ command.complete(completion, context, shell, true);
}
}
String partial;
Modified: trunk/shell/src/test/org/jnode/test/shell/bjorne/BjorneCompletionTest.java
===================================================================
--- trunk/shell/src/test/org/jnode/test/shell/bjorne/BjorneCompletionTest.java 2009-06-08 07:16:12 UTC (rev 5559)
+++ trunk/shell/src/test/org/jnode/test/shell/bjorne/BjorneCompletionTest.java 2009-06-08 07:34:35 UTC (rev 5560)
@@ -105,6 +105,10 @@
public void testPipe2Command() throws ShellSyntaxException, CompletionException {
doCompletionTest("echo hi |\necho", "TETT");
}
+
+ public void testSourceCommand() throws ShellSyntaxException, CompletionException {
+ doCompletionTest("source /", "TT");
+ }
public void testIfCommand() throws ShellSyntaxException, CompletionException {
doCompletionTest("if cpuid ; then echo hi ; fi", "TTTTTETT");
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|