You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@avalon.apache.org by mc...@apache.org on 2003/06/09 03:01:42 UTC
cvs commit: avalon-sandbox/merlin/merlin-cli/src/java Merlin.java Resources.properties
mcconnell 2003/06/08 18:01:42
Modified: merlin/merlin-cli/src/java Merlin.java Resources.properties
Log:
Added command line option (-execute) to instruct Merlin to execute and exit immediately.
Revision Changes Path
1.11 +20 -1 avalon-sandbox/merlin/merlin-cli/src/java/Merlin.java
Index: Merlin.java
===================================================================
RCS file: /home/cvs/avalon-sandbox/merlin/merlin-cli/src/java/Merlin.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- Merlin.java 8 May 2003 03:02:40 -0000 1.10
+++ Merlin.java 9 Jun 2003 01:01:42 -0000 1.11
@@ -112,6 +112,10 @@
"version",
I18N.getString( "cli-version-description" ) );
+ Option execute = new Option(
+ "execute",
+ I18N.getString( "cli-execute-description" ) );
+
Option debug = new Option(
"debug",
I18N.getString( "cli-debug-description" ) );
@@ -147,6 +151,7 @@
.create( "kernel" );
options.addOption( help );
+ options.addOption( execute );
options.addOption( version );
options.addOption( debug );
options.addOption( system );
@@ -176,9 +181,10 @@
Map map = new Hashtable();
CommandLineParser parser = new BasicParser();
+ CommandLine line = null;
try
{
- CommandLine line = parser.parse( CL_OPTIONS, args );
+ line = parser.parse( CL_OPTIONS, args );
if( line.hasOption( "lang" ) )
{
@@ -289,6 +295,14 @@
{
map.put( "urn:merlin:block.config", config.toURL() );
}
+ if( line.hasOption( "execute" ) )
+ {
+ map.put( "urn:merlin:kernel.server", "false" );
+ }
+ else
+ {
+ map.put( "urn:merlin:kernel.server", "true" );
+ }
//
// if the -debug switch is on then dump the context information
@@ -406,6 +420,7 @@
Method method =
kernelLoader.getClass().getMethod( "build", new Class[]{ Map.class } );
method.invoke( kernelLoader, new Object[]{ map } );
+
}
catch( Throwable e )
{
@@ -414,6 +429,10 @@
throw new BootstrapRuntimeException( error, e );
}
+ if( line.hasOption( "execute" ) )
+ {
+ System.exit( 0 );
+ }
}
private static String getVersionString()
1.2 +2 -0 avalon-sandbox/merlin/merlin-cli/src/java/Resources.properties
Index: Resources.properties
===================================================================
RCS file: /home/cvs/avalon-sandbox/merlin/merlin-cli/src/java/Resources.properties,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- Resources.properties 13 Mar 2003 01:04:58 -0000 1.1
+++ Resources.properties 9 Jun 2003 01:01:42 -0000 1.2
@@ -7,6 +7,8 @@
cli-language-description=A two-letter language code.
+cli-execute-description=If present the kernel will initiate shutdown immediately following deployment.
+
cli-version-description=Prints Merlin version information.
cli-debug-description=Enable debug messages during the bootstrap phase.
---------------------------------------------------------------------
To unsubscribe, e-mail: cvs-unsubscribe@avalon.apache.org
For additional commands, e-mail: cvs-help@avalon.apache.org