You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by er...@apache.org on 2011/06/19 12:39:37 UTC

svn commit: r1137332 - /james/server/trunk/cli/src/main/java/org/apache/james/cli/ServerCmd.java

Author: eric
Date: Sun Jun 19 10:39:36 2011
New Revision: 1137332

URL: http://svn.apache.org/viewvc?rev=1137332&view=rev
Log:
Print on command line interface a confirmation message in case of successful command (JAMES-1233)

Modified:
    james/server/trunk/cli/src/main/java/org/apache/james/cli/ServerCmd.java

Modified: james/server/trunk/cli/src/main/java/org/apache/james/cli/ServerCmd.java
URL: http://svn.apache.org/viewvc/james/server/trunk/cli/src/main/java/org/apache/james/cli/ServerCmd.java?rev=1137332&r1=1137331&r2=1137332&view=diff
==============================================================================
--- james/server/trunk/cli/src/main/java/org/apache/james/cli/ServerCmd.java (original)
+++ james/server/trunk/cli/src/main/java/org/apache/james/cli/ServerCmd.java Sun Jun 19 10:39:36 2011
@@ -20,6 +20,7 @@ package org.apache.james.cli;
 
 import java.io.IOException;
 import java.io.PrintStream;
+import java.util.Calendar;
 import java.util.Collection;
 import java.util.Iterator;
 import java.util.Map;
@@ -65,6 +66,9 @@ public class ServerCmd {
      * @throws ParseException
      */
     public static void main(String[] args) throws IOException, InterruptedException, ParseException {
+        
+        long start = Calendar.getInstance().getTimeInMillis();
+        
         CommandLineParser parser = new PosixParser();
         CommandLine cmd = null;
 
@@ -109,8 +113,10 @@ public class ServerCmd {
         // Execute the requested command.
         String[] arguments = cmd.getArgs();
         String cmdName = arguments[0];
+        CmdType cmdType = null;
         try {
-            CmdType cmdType = CmdType.lookup(cmdName);
+
+            cmdType = CmdType.lookup(cmdName);
 
             if (CmdType.ADDUSER.equals(cmdType)) {
                 if (cmdType.hasCorrectArguments(arguments.length)) {
@@ -205,7 +211,9 @@ public class ServerCmd {
             sCmd.onException(e, System.err);
             System.exit(1);
         }
-
+        
+        sCmd.print(new String[]{cmdType.getCommand() + " command executed sucessfully in " 
+                + (Calendar.getInstance().getTimeInMillis() - start) + " ms."}, System.out);
         System.exit(0);
     }
 



---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org