geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jdil...@apache.org
Subject svn commit: r705683 - in /geronimo/gshell/trunk: gshell-cli/src/main/java/org/apache/geronimo/gshell/cli/ gshell-wisdom/gshell-wisdom-bootstrap/src/main/java/org/apache/geronimo/gshell/wisdom/builder/
Date Fri, 17 Oct 2008 17:42:43 GMT
Author: jdillon
Date: Fri Oct 17 10:42:43 2008
New Revision: 705683

URL: http://svn.apache.org/viewvc?rev=705683&view=rev
Log:
Fixed access to program name + version via Main

Modified:
    geronimo/gshell/trunk/gshell-cli/src/main/java/org/apache/geronimo/gshell/cli/Main.java
    geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-bootstrap/src/main/java/org/apache/geronimo/gshell/wisdom/builder/ShellBuilder.java
    geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-bootstrap/src/main/java/org/apache/geronimo/gshell/wisdom/builder/ShellBuilderImpl.java

Modified: geronimo/gshell/trunk/gshell-cli/src/main/java/org/apache/geronimo/gshell/cli/Main.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-cli/src/main/java/org/apache/geronimo/gshell/cli/Main.java?rev=705683&r1=705682&r2=705683&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-cli/src/main/java/org/apache/geronimo/gshell/cli/Main.java
(original)
+++ geronimo/gshell/trunk/gshell-cli/src/main/java/org/apache/geronimo/gshell/cli/Main.java
Fri Oct 17 10:42:43 2008
@@ -35,6 +35,7 @@
 import org.apache.geronimo.gshell.terminal.WindowsTerminal;
 import org.apache.geronimo.gshell.wisdom.builder.ShellBuilder;
 import org.apache.geronimo.gshell.wisdom.builder.ShellBuilderImpl;
+import org.apache.geronimo.gshell.application.model.ApplicationModel;
 
 import java.util.List;
 import java.util.concurrent.atomic.AtomicReference;
@@ -204,14 +205,15 @@
 
             // --help and --version need access to the application's information, so we have
to handle these options late
             if (help|version) {
+                ApplicationModel applicationModel = builder.getApplicationModel();
+
                 if (help) {
                     Printer printer = new Printer(clp);
                     printer.setMessageSource(messages);
-                    printer.printUsage(io.out, "FIXME"/*applicationModel.getBranding().getProgramName()*/);
+                    printer.printUsage(io.out, applicationModel.getBranding().getProgramName());
                 }
                 else if (version) {
-                    io.out.println("FIXME"/*applicationModel.getVersion()*/);
-                    io.out.println();
+                    io.out.println(applicationModel.getVersion());
                 }
 
                 io.out.flush();

Modified: geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-bootstrap/src/main/java/org/apache/geronimo/gshell/wisdom/builder/ShellBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-bootstrap/src/main/java/org/apache/geronimo/gshell/wisdom/builder/ShellBuilder.java?rev=705683&r1=705682&r2=705683&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-bootstrap/src/main/java/org/apache/geronimo/gshell/wisdom/builder/ShellBuilder.java
(original)
+++ geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-bootstrap/src/main/java/org/apache/geronimo/gshell/wisdom/builder/ShellBuilder.java
Fri Oct 17 10:42:43 2008
@@ -20,6 +20,7 @@
 package org.apache.geronimo.gshell.wisdom.builder;
 
 import org.apache.geronimo.gshell.application.ApplicationManager;
+import org.apache.geronimo.gshell.application.model.ApplicationModel;
 import org.apache.geronimo.gshell.command.Variables;
 import org.apache.geronimo.gshell.io.IO;
 import org.apache.geronimo.gshell.shell.ShellFactory;
@@ -47,4 +48,6 @@
     ApplicationManager getApplicationManager();
 
     void setApplicationManager(ApplicationManager applicationManager);
+
+    ApplicationModel getApplicationModel();
 }
\ No newline at end of file

Modified: geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-bootstrap/src/main/java/org/apache/geronimo/gshell/wisdom/builder/ShellBuilderImpl.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-bootstrap/src/main/java/org/apache/geronimo/gshell/wisdom/builder/ShellBuilderImpl.java?rev=705683&r1=705682&r2=705683&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-bootstrap/src/main/java/org/apache/geronimo/gshell/wisdom/builder/ShellBuilderImpl.java
(original)
+++ geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-bootstrap/src/main/java/org/apache/geronimo/gshell/wisdom/builder/ShellBuilderImpl.java
Fri Oct 17 10:42:43 2008
@@ -114,6 +114,10 @@
         this.applicationManager = applicationManager;
     }
 
+    public ApplicationModel getApplicationModel() {
+        return getContainer().getBean(ApplicationModel.class);
+    }
+
     //
     // ShellFactory
     //
@@ -153,8 +157,7 @@
         // ArtifactManager artifactManager = getContainer().getBean(ArtifactManager.class);
         // artifactManager.setDownloadMonitor(new ProgressSpinnerMonitor(getIo()));
 
-        ApplicationModel applicationModel = container.getBean(ApplicationModel.class);
-        applicationConfig.setModel(applicationModel);
+        applicationConfig.setModel(getApplicationModel());
 
         // Configure application
         getApplicationManager().configure(applicationConfig);



Mime
View raw message