@@ -89,9 +89,12 @@ public void printUsage(String cmdString, String comment) {
8989 out .println ("use:" );
9090 switch (cmdString ) {
9191 case CONNECT :
92- out .println (CONNECT + " IP/DNS-Name_remoteHost remotePort" );
92+ out .println (CONNECT + " [IP/DNS-Name_remoteHost] remotePort engineName" );
93+ out .println ("omitting remote host: localhost is assumed" );
9394 out .println ("example: " + CONNECT + " localhost 7070 Bob" );
94- out .println ("tries to connect to localhost:7070 and let engine Bob handle connection when established" );
95+ out .println ("example: " + CONNECT + " 7070 Bob" );
96+ out .println ("in both cases try to connect to localhost:7070 and let engine Bob handle connection when established" );
97+
9598 break ;
9699 case OPEN :
97100 out .println (OPEN + " localPort engineName" );
@@ -226,7 +229,15 @@ private void doConnect(String parameterString) {
226229 try {
227230 String remoteHost = st .nextToken ();
228231 String remotePortString = st .nextToken ();
229- String engineName = st .nextToken ();
232+ String engineName = null ;
233+ if (!st .hasMoreTokens ()) {
234+ // no remote host set - shift
235+ engineName = remotePortString ;
236+ remotePortString = remoteHost ;
237+ remoteHost = "localhost" ;
238+ } else {
239+ engineName = st .nextToken ();
240+ }
230241 int remotePort = Integer .parseInt (remotePortString );
231242
232243 String name = remoteHost + ":" + remotePortString ;
@@ -264,6 +275,10 @@ private void doList() {
264275 for (String connectionName : this .channels .keySet ()) {
265276 System .out .println (connectionName );
266277 }
278+ System .out .println ("storages:" );
279+ for (String storageName : this .storages .keySet ()) {
280+ System .out .println (storageName );
281+ }
267282 System .out .println ("engines:" );
268283 for (String engineName : this .engines .keySet ()) {
269284 System .out .println (engineName );
0 commit comments