|
From: <cr...@us...> - 2009-05-31 04:15:59
|
Revision: 5532
http://jnode.svn.sourceforge.net/jnode/?rev=5532&view=rev
Author: crawley
Date: 2009-05-31 04:15:41 +0000 (Sun, 31 May 2009)
Log Message:
-----------
Completion tidyups
Modified Paths:
--------------
trunk/shell/src/shell/org/jnode/shell/ArgumentCompleter.java
trunk/shell/src/shell/org/jnode/shell/bjorne/BjorneCompleter.java
trunk/shell/src/test/org/jnode/test/shell/bjorne/BjorneCompletionTests.java
Modified: trunk/shell/src/shell/org/jnode/shell/ArgumentCompleter.java
===================================================================
--- trunk/shell/src/shell/org/jnode/shell/ArgumentCompleter.java 2009-05-31 02:13:50 UTC (rev 5531)
+++ trunk/shell/src/shell/org/jnode/shell/ArgumentCompleter.java 2009-05-31 04:15:41 UTC (rev 5532)
@@ -51,7 +51,6 @@
}
public void complete(CompletionInfo completion, CommandShell shell) {
- Logger.getLogger(ArgumentCompleter.class).debug("text = " + (token == null ? "" : token.text));
argument.complete(completion, token == null ? "" : token.text, 0);
if (token != null) {
completion.setCompletionStart(token.start);
Modified: trunk/shell/src/shell/org/jnode/shell/bjorne/BjorneCompleter.java
===================================================================
--- trunk/shell/src/shell/org/jnode/shell/bjorne/BjorneCompleter.java 2009-05-31 02:13:50 UTC (rev 5531)
+++ trunk/shell/src/shell/org/jnode/shell/bjorne/BjorneCompleter.java 2009-05-31 04:15:41 UTC (rev 5532)
@@ -61,11 +61,9 @@
}
if (command != null) {
BjorneToken[] words = command.getWords();
- if (words.length > 0 && words[words.length - 1] == penultimateToken) {
+ 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 == 0) {
- new CommandLine(null, null).complete(completion, shell);
}
}
String partial;
Modified: trunk/shell/src/test/org/jnode/test/shell/bjorne/BjorneCompletionTests.java
===================================================================
--- trunk/shell/src/test/org/jnode/test/shell/bjorne/BjorneCompletionTests.java 2009-05-31 02:13:50 UTC (rev 5531)
+++ trunk/shell/src/test/org/jnode/test/shell/bjorne/BjorneCompletionTests.java 2009-05-31 04:15:41 UTC (rev 5532)
@@ -228,7 +228,7 @@
public void testBad2Command() throws ShellSyntaxException, CompletionException {
try {
- doCompletionTest("if fi ;", "T?");
+ doCompletionTest("if fi ;", "T??");
} catch (CompletionException ex) {
assertEquals("Cannot find an alias or load a command class for 'fi'", ex.getMessage());
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|