You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by jd...@apache.org on 2008/09/30 08:03:47 UTC

svn commit: r700354 - in /geronimo/gshell/trunk/gshell-commands/gshell-optional/src/main: java/org/apache/geronimo/gshell/commands/optional/ resources/META-INF/spring/ resources/org/apache/geronimo/gshell/commands/optional/

Author: jdillon
Date: Mon Sep 29 23:03:46 2008
New Revision: 700354

URL: http://svn.apache.org/viewvc?rev=700354&view=rev
Log:
Added 'date' command

Added:
    geronimo/gshell/trunk/gshell-commands/gshell-optional/src/main/java/org/apache/geronimo/gshell/commands/optional/DateAction.java   (with props)
    geronimo/gshell/trunk/gshell-commands/gshell-optional/src/main/resources/org/apache/geronimo/gshell/commands/optional/DateAction.properties   (contents, props changed)
      - copied, changed from r700230, geronimo/gshell/trunk/gshell-commands/gshell-optional/src/main/resources/org/apache/geronimo/gshell/commands/optional/SleepAction.properties
Modified:
    geronimo/gshell/trunk/gshell-commands/gshell-optional/src/main/resources/META-INF/spring/components.xml

Added: geronimo/gshell/trunk/gshell-commands/gshell-optional/src/main/java/org/apache/geronimo/gshell/commands/optional/DateAction.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-commands/gshell-optional/src/main/java/org/apache/geronimo/gshell/commands/optional/DateAction.java?rev=700354&view=auto
==============================================================================
--- geronimo/gshell/trunk/gshell-commands/gshell-optional/src/main/java/org/apache/geronimo/gshell/commands/optional/DateAction.java (added)
+++ geronimo/gshell/trunk/gshell-commands/gshell-optional/src/main/java/org/apache/geronimo/gshell/commands/optional/DateAction.java Mon Sep 29 23:03:46 2008
@@ -0,0 +1,45 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.geronimo.gshell.commands.optional;
+
+import org.apache.geronimo.gshell.command.CommandAction;
+import org.apache.geronimo.gshell.command.CommandContext;
+import org.apache.geronimo.gshell.io.IO;
+
+import java.text.DateFormat;
+import java.util.Date;
+
+/**
+ * Displays the current time and date.
+ *
+ * @version $Rev$ $Date$
+ */
+public class DateAction
+    implements CommandAction
+{
+    public Object execute(final CommandContext context) throws Exception {
+        assert context != null;
+        IO io = context.getIo();
+
+        io.info(DateFormat.getInstance().format(new Date()));
+
+        return Result.SUCCESS;
+    }
+}

Propchange: geronimo/gshell/trunk/gshell-commands/gshell-optional/src/main/java/org/apache/geronimo/gshell/commands/optional/DateAction.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/gshell/trunk/gshell-commands/gshell-optional/src/main/java/org/apache/geronimo/gshell/commands/optional/DateAction.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/gshell/trunk/gshell-commands/gshell-optional/src/main/java/org/apache/geronimo/gshell/commands/optional/DateAction.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: geronimo/gshell/trunk/gshell-commands/gshell-optional/src/main/resources/META-INF/spring/components.xml
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-commands/gshell-optional/src/main/resources/META-INF/spring/components.xml?rev=700354&r1=700353&r2=700354&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-commands/gshell-optional/src/main/resources/META-INF/spring/components.xml (original)
+++ geronimo/gshell/trunk/gshell-commands/gshell-optional/src/main/resources/META-INF/spring/components.xml Mon Sep 29 23:03:46 2008
@@ -40,6 +40,10 @@
             <gshell:command name="sleep">
                 <gshell:action class="org.apache.geronimo.gshell.commands.optional.SleepAction"/>
             </gshell:command>
+
+            <gshell:command name="date">
+                <gshell:action class="org.apache.geronimo.gshell.commands.optional.DateAction"/>
+            </gshell:command>
         </gshell:command-bundle>
     </gshell:plugin>
 

Copied: geronimo/gshell/trunk/gshell-commands/gshell-optional/src/main/resources/org/apache/geronimo/gshell/commands/optional/DateAction.properties (from r700230, geronimo/gshell/trunk/gshell-commands/gshell-optional/src/main/resources/org/apache/geronimo/gshell/commands/optional/SleepAction.properties)
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-commands/gshell-optional/src/main/resources/org/apache/geronimo/gshell/commands/optional/DateAction.properties?p2=geronimo/gshell/trunk/gshell-commands/gshell-optional/src/main/resources/org/apache/geronimo/gshell/commands/optional/DateAction.properties&p1=geronimo/gshell/trunk/gshell-commands/gshell-optional/src/main/resources/org/apache/geronimo/gshell/commands/optional/SleepAction.properties&r1=700230&r2=700354&rev=700354&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-commands/gshell-optional/src/main/resources/org/apache/geronimo/gshell/commands/optional/SleepAction.properties (original)
+++ geronimo/gshell/trunk/gshell-commands/gshell-optional/src/main/resources/org/apache/geronimo/gshell/commands/optional/DateAction.properties Mon Sep 29 23:03:46 2008
@@ -21,12 +21,9 @@
 ## $Rev$ $Date$
 ##
 
-command.name=sleep
+command.name=date
 
-command.description=Sleep for a bit then wake up.
-
-command.argument.time=Time in milliseconds
-command.argument.time.token=MS
+command.description=Displays the current time and date.
 
 command.manual=\
-  TODO: sleep manual
\ No newline at end of file
+  TODO: date manual
\ No newline at end of file

Propchange: geronimo/gshell/trunk/gshell-commands/gshell-optional/src/main/resources/org/apache/geronimo/gshell/commands/optional/DateAction.properties
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/gshell/trunk/gshell-commands/gshell-optional/src/main/resources/org/apache/geronimo/gshell/commands/optional/DateAction.properties
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/gshell/trunk/gshell-commands/gshell-optional/src/main/resources/org/apache/geronimo/gshell/commands/optional/DateAction.properties
------------------------------------------------------------------------------
    svn:mergeinfo = 

Propchange: geronimo/gshell/trunk/gshell-commands/gshell-optional/src/main/resources/org/apache/geronimo/gshell/commands/optional/DateAction.properties
------------------------------------------------------------------------------
    svn:mime-type = text/plain