From f6fa7331f99dc1dce1fd95be8d06c55ac9c55a65 Mon Sep 17 00:00:00 2001 From: antelder Date: Tue, 6 Jul 2010 20:11:44 +0000 Subject: Update install to not require the -uri flag to specify a uri but instead just use positional uri url parameters git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@961005 13f79535-47bb-0310-9956-ffa450edef68 --- .../java/org/apache/tuscany/sca/shell/Shell.java | 53 ++++++++++++++++------ 1 file changed, 38 insertions(+), 15 deletions(-) diff --git a/sca-java-2.x/trunk/modules/shell/src/main/java/org/apache/tuscany/sca/shell/Shell.java b/sca-java-2.x/trunk/modules/shell/src/main/java/org/apache/tuscany/sca/shell/Shell.java index 0351baacf5..ac3b2d8faf 100644 --- a/sca-java-2.x/trunk/modules/shell/src/main/java/org/apache/tuscany/sca/shell/Shell.java +++ b/sca-java-2.x/trunk/modules/shell/src/main/java/org/apache/tuscany/sca/shell/Shell.java @@ -90,15 +90,8 @@ public class Shell { return true; } - boolean install(final String cloc, final List toks) throws ContributionReadException, ActivationException, ValidationException { + boolean install(final List toks) throws ContributionReadException, ActivationException, ValidationException { boolean runDeployables = !toks.contains("-norun"); - String uri; - if (toks.contains("-uri")) { - uri = toks.get(toks.indexOf("-uri")+1); - } else { - uri = getDefaultURI(cloc); - out.println("installing at: " + uri); - } String metaDataURL = null; if (toks.contains("-metadata")) { metaDataURL = toks.get(toks.indexOf("-metadata")+1); @@ -107,8 +100,36 @@ public class Shell { if (toks.contains("-duris")) { duris = Arrays.asList(toks.get(toks.indexOf("-duris")+1).split(",")); } + + String first = null; + String second = null; + for (int i=1; i() { public Boolean call() throws Exception { - return install(toks.get(1), toks); + return install(toks); }}; if (op.equals("installed")) return new Callable() { public Boolean call() throws Exception { return installed(toks); @@ -404,7 +425,7 @@ public class Shell { out.println("Commands:"); out.println(); out.println(" help"); - out.println(" install [-uri -norun -metadata -duris ]"); + out.println(" install [] [-norun -metadata -duris ]"); out.println(" installed []"); out.println(" remove "); out.println(" addDeploymentComposite "); @@ -417,6 +438,8 @@ public class Shell { out.println(" status [ ]"); out.println(" stop [ ]"); out.println(); + out.println("For detailed help on each command do 'help ', for help of startup options do 'help startup'"); + out.println(); return true; } void helpHelp() { @@ -450,14 +473,14 @@ public class Shell { } void helpInstall() { - out.println(" install [-uri -norun -metadata -duris ]"); + out.println(" install [] [-norun -metadata -duris ]"); out.println(); - out.println(" Creates an installed contribution with a supplied root contribution, installed at base URI."); + out.println(" Creates an installed contribution with a supplied root contribution, installed at abase URI."); out.println(); out.println(" Arguments:"); + out.println(" uri - (optional) the URI (name) to use for the contribution. When no uri is specified"); + out.println(" a default URI is used derived from the contribution URL"); out.println(" contributionURL - (required) the URL to the contribution to install"); - out.println(" -uri - (optional) the URI (name) to use for the contribution. When"); - out.println(" no uri is defined a default URI is automatically choosen based on the contribution URL"); out.println(" -norun - (optional) do not start any composites listed as deployable in the sca-contribution.xml file"); out.println(" -metadata - (optional) the URL to an external contribution meta data document that should be"); out.println(" merged into any existing sca-contributions.xml file within the contribution."); -- cgit v1.2.3