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 2006/06/03 07:56:25 UTC
svn commit: r411388 -
/geronimo/sandbox/gshell/trunk/gshell-cli/src/main/java/org/apache/geronimo/gshell/cli/Main.java
Author: jdillon
Date: Fri Jun 2 22:56:25 2006
New Revision: 411388
URL: http://svn.apache.org/viewvc?rev=411388&view=rev
Log:
Added -n to force non-interactive
Modified:
geronimo/sandbox/gshell/trunk/gshell-cli/src/main/java/org/apache/geronimo/gshell/cli/Main.java
Modified: geronimo/sandbox/gshell/trunk/gshell-cli/src/main/java/org/apache/geronimo/gshell/cli/Main.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-cli/src/main/java/org/apache/geronimo/gshell/cli/Main.java?rev=411388&r1=411387&r2=411388&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-cli/src/main/java/org/apache/geronimo/gshell/cli/Main.java (original)
+++ geronimo/sandbox/gshell/trunk/gshell-cli/src/main/java/org/apache/geronimo/gshell/cli/Main.java Fri Jun 2 22:56:25 2006
@@ -114,6 +114,10 @@
.withDescription("Run in interactive mode")
.create('i'));
+ options.addOption(OptionBuilder.withLongOpt("non-interactive")
+ .withDescription("Run in non-interactive mode")
+ .create('n'));
+
//
// TODO: Add these output modifiers to a seperate group
//
@@ -133,6 +137,11 @@
CommandLineParser parser = new PosixParser();
CommandLine line = parser.parse(options, args, true);
+ // Force interactive if there are no args
+ if (line.getArgs().length == 0) {
+ interactive = true;
+ }
+
if (line.hasOption('h')) {
io.out.println(Banner.getBanner());
@@ -184,6 +193,9 @@
if (line.hasOption('i')) {
interactive = true;
}
+ else if (line.hasOption('n')) {
+ interactive = false;
+ }
execute(line.getArgs());
}
@@ -200,11 +212,6 @@
// Startup the shell
final Shell gshell = new Shell(io);
- // Force interactive if there are no args
- if (args.length == 0) {
- interactive = true;
- }
-
//
// TEMP: Log some info about the terminal
//
@@ -226,7 +233,13 @@
int status = 0;
+ //
+ // TODO: Pass interactive flags (maybe as property) so gshell knows what mode it is
+ //
+
if (interactive) {
+ log.debug("Starting interactive console");
+
//
// HACK: This is JLine specific... refactor
//