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/25 10:32:28 UTC

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

Author: jdillon
Date: Thu Sep 25 01:32:28 2008
New Revision: 698865

URL: http://svn.apache.org/viewvc?rev=698865&view=rev
Log:
Start of 'alias' and 'unalias' commands

Added:
    geronimo/gshell/trunk/gshell-commands/gshell-builtins/src/main/java/org/apache/geronimo/gshell/commands/builtins/AliasAction.java   (with props)
    geronimo/gshell/trunk/gshell-commands/gshell-builtins/src/main/java/org/apache/geronimo/gshell/commands/builtins/UnaliasAction.java   (with props)
    geronimo/gshell/trunk/gshell-commands/gshell-builtins/src/main/resources/org/apache/geronimo/gshell/commands/builtins/AliasAction.properties   (with props)
    geronimo/gshell/trunk/gshell-commands/gshell-builtins/src/main/resources/org/apache/geronimo/gshell/commands/builtins/UnaliasAction.properties   (with props)
Modified:
    geronimo/gshell/trunk/gshell-commands/gshell-builtins/src/main/resources/META-INF/spring/components.xml

Added: geronimo/gshell/trunk/gshell-commands/gshell-builtins/src/main/java/org/apache/geronimo/gshell/commands/builtins/AliasAction.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-commands/gshell-builtins/src/main/java/org/apache/geronimo/gshell/commands/builtins/AliasAction.java?rev=698865&view=auto
==============================================================================
--- geronimo/gshell/trunk/gshell-commands/gshell-builtins/src/main/java/org/apache/geronimo/gshell/commands/builtins/AliasAction.java (added)
+++ geronimo/gshell/trunk/gshell-commands/gshell-builtins/src/main/java/org/apache/geronimo/gshell/commands/builtins/AliasAction.java Thu Sep 25 01:32:28 2008
@@ -0,0 +1,68 @@
+/*
+ * 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.builtins;
+
+import org.apache.geronimo.gshell.command.CommandAction;
+import org.apache.geronimo.gshell.command.CommandContext;
+import org.apache.geronimo.gshell.clp.Argument;
+import org.apache.geronimo.gshell.io.IO;
+import org.apache.geronimo.gshell.i18n.MessageSource;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Define an alias.
+ *
+ * @version $Rev$ $Date$
+ */
+public class AliasAction
+    implements CommandAction
+{
+    private final Logger log = LoggerFactory.getLogger(getClass());
+
+    @Argument(index=0)
+    private String name;
+
+    @Argument(index=1)
+    private String target;
+
+    public Object execute(final CommandContext context) throws Exception {
+        assert context != null;
+        IO io = context.getIo();
+        MessageSource messages = context.getCommand().getMessages();
+
+        if (name == null) {
+            log.debug("Listing defined aliases");
+            
+            // TODO: List aliases
+        }
+        else if (target == null) {
+            io.error("Missing argument: {}", messages.getMessage("command.argument.target.token"));
+            return Result.FAILURE;
+        }
+        else {
+            log.debug("Defining alias: {} -> {}", name, target);
+
+            // TODO: Define alias
+        }
+
+        return Result.SUCCESS;
+    }
+}

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

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

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

Added: geronimo/gshell/trunk/gshell-commands/gshell-builtins/src/main/java/org/apache/geronimo/gshell/commands/builtins/UnaliasAction.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-commands/gshell-builtins/src/main/java/org/apache/geronimo/gshell/commands/builtins/UnaliasAction.java?rev=698865&view=auto
==============================================================================
--- geronimo/gshell/trunk/gshell-commands/gshell-builtins/src/main/java/org/apache/geronimo/gshell/commands/builtins/UnaliasAction.java (added)
+++ geronimo/gshell/trunk/gshell-commands/gshell-builtins/src/main/java/org/apache/geronimo/gshell/commands/builtins/UnaliasAction.java Thu Sep 25 01:32:28 2008
@@ -0,0 +1,50 @@
+/*
+ * 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.builtins;
+
+import org.apache.geronimo.gshell.command.CommandAction;
+import org.apache.geronimo.gshell.command.CommandContext;
+import org.apache.geronimo.gshell.clp.Argument;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Undefine an alias.
+ *
+ * @version $Rev$ $Date$
+ */
+public class UnaliasAction
+    implements CommandAction
+{
+    private final Logger log = LoggerFactory.getLogger(getClass());
+    
+    @Argument(index=0, required=true)
+    private String name;
+
+    public Object execute(final CommandContext context) throws Exception {
+        assert context != null;
+
+        log.debug("Undefining alias: {}", name);
+
+        // TODO:
+
+        return Result.SUCCESS;
+    }
+}
\ No newline at end of file

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

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

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

Modified: geronimo/gshell/trunk/gshell-commands/gshell-builtins/src/main/resources/META-INF/spring/components.xml
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-commands/gshell-builtins/src/main/resources/META-INF/spring/components.xml?rev=698865&r1=698864&r2=698865&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-commands/gshell-builtins/src/main/resources/META-INF/spring/components.xml (original)
+++ geronimo/gshell/trunk/gshell-commands/gshell-builtins/src/main/resources/META-INF/spring/components.xml Thu Sep 25 01:32:28 2008
@@ -57,7 +57,6 @@
                 <gshell:action class="org.apache.geronimo.gshell.commands.builtins.UnsetAction"/>
             </gshell:command>
 
-            <!--
             <gshell:command name="alias">
                 <gshell:action class="org.apache.geronimo.gshell.commands.builtins.AliasAction"/>
             </gshell:command>
@@ -65,7 +64,6 @@
             <gshell:command name="unalias">
                 <gshell:action class="org.apache.geronimo.gshell.commands.builtins.UnaliasAction"/>
             </gshell:command>
-            -->
             
             <gshell:command name="history">
                 <gshell:action class="org.apache.geronimo.gshell.commands.builtins.HistoryAction"/>

Added: geronimo/gshell/trunk/gshell-commands/gshell-builtins/src/main/resources/org/apache/geronimo/gshell/commands/builtins/AliasAction.properties
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-commands/gshell-builtins/src/main/resources/org/apache/geronimo/gshell/commands/builtins/AliasAction.properties?rev=698865&view=auto
==============================================================================
--- geronimo/gshell/trunk/gshell-commands/gshell-builtins/src/main/resources/org/apache/geronimo/gshell/commands/builtins/AliasAction.properties (added)
+++ geronimo/gshell/trunk/gshell-commands/gshell-builtins/src/main/resources/org/apache/geronimo/gshell/commands/builtins/AliasAction.properties Thu Sep 25 01:32:28 2008
@@ -0,0 +1,35 @@
+##
+## 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.
+##
+
+##
+## $Rev$ $Date$
+##
+
+command.name=alias
+
+command.description=Define an alias.
+
+command.argument.name=Name of the alias to define.
+command.argument.name.token=NAME
+
+command.argument.target=Target command to be aliased as NAME.
+command.argument.target.token=TARGET
+
+command.manual=\
+  TODO: alias manual
\ No newline at end of file

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

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

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

Added: geronimo/gshell/trunk/gshell-commands/gshell-builtins/src/main/resources/org/apache/geronimo/gshell/commands/builtins/UnaliasAction.properties
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-commands/gshell-builtins/src/main/resources/org/apache/geronimo/gshell/commands/builtins/UnaliasAction.properties?rev=698865&view=auto
==============================================================================
--- geronimo/gshell/trunk/gshell-commands/gshell-builtins/src/main/resources/org/apache/geronimo/gshell/commands/builtins/UnaliasAction.properties (added)
+++ geronimo/gshell/trunk/gshell-commands/gshell-builtins/src/main/resources/org/apache/geronimo/gshell/commands/builtins/UnaliasAction.properties Thu Sep 25 01:32:28 2008
@@ -0,0 +1,32 @@
+##
+## 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.
+##
+
+##
+## $Rev$ $Date$
+##
+
+command.name=unalias
+
+command.description=Undefine an alias.
+
+command.argument.name=Name of the alias to undefine.
+command.argument.name.token=NAME
+
+command.manual=\
+  TODO: unalias manual
\ No newline at end of file

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

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

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