From e11f786b9306642e67f6004e4f5fef2fabe7cc92 Mon Sep 17 00:00:00 2001 From: "Timothy A. Bish" Date: Thu, 20 Sep 2012 05:02:39 +0000 Subject: [PATCH] apply patch for: https://issues.apache.org/jira/browse/AMQ-3554 git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@1387857 13f79535-47bb-0310-9956-ffa450edef68 --- .../activemq/karaf/commands/CreateBrokerCommand.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/activemq-karaf/src/main/java/org/apache/activemq/karaf/commands/CreateBrokerCommand.java b/activemq-karaf/src/main/java/org/apache/activemq/karaf/commands/CreateBrokerCommand.java index 87ce530c38..2dc6c5a527 100644 --- a/activemq-karaf/src/main/java/org/apache/activemq/karaf/commands/CreateBrokerCommand.java +++ b/activemq-karaf/src/main/java/org/apache/activemq/karaf/commands/CreateBrokerCommand.java @@ -26,8 +26,9 @@ import java.util.HashMap; import java.util.Map; import java.util.Scanner; -import org.apache.felix.gogo.commands.Option; +import org.apache.felix.gogo.commands.Argument; import org.apache.felix.gogo.commands.Command; +import org.apache.felix.gogo.commands.Option; import org.apache.karaf.shell.console.OsgiCommandSupport; /** @@ -35,8 +36,8 @@ import org.apache.karaf.shell.console.OsgiCommandSupport; */ @Command(scope="activemq", name="create-broker", description="Creates a broker instance.") public class CreateBrokerCommand extends OsgiCommandSupport { - - @Option(name = "-n", aliases = {"--name"}, description = "The name of the broker (defaults to localhost).") + + @Argument(name = "name", description = "The name of the broker (defaults to localhost).") private String name = "localhost"; @Option(name = "-t", aliases = {"--type"}, description = "type of configuration to be used: spring or blueprint (defaults to spring)") private String type = "spring"; @@ -58,12 +59,12 @@ public class CreateBrokerCommand extends OsgiCommandSupport { mkdir(deploy); File configFile = new File(deploy, name + "-broker.xml"); - + if (!type.equalsIgnoreCase("spring") && !type.equalsIgnoreCase("blueprint")) { System.out.println("@|green Unknown type '" + type + "' Using spring by default"); type = "spring"; } - + copyFilteredResourceTo(configFile, type.toLowerCase() + ".xml", props); System.out.println("");