From 83a2ce4071731aaba970d24e339bb9fb4823c363 Mon Sep 17 00:00:00 2001 From: antelder Date: Tue, 30 Nov 2010 08:57:05 +0000 Subject: Fix the passing in of an initial contribution url, and add the start of a status command git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1040437 13f79535-47bb-0310-9956-ffa450edef68 --- .../java/org/apache/tuscany/sca/shell/Shell.java | 30 +++++++++++++++++++--- 1 file changed, 26 insertions(+), 4 deletions(-) (limited to 'sca-java-2.x') 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 716bdc1585..1174506613 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 @@ -79,11 +79,10 @@ public class Shell { if ("-nojline".equals(s)) { useJline = false; } else { - File f = new File(s); - if (f.exists()) { - contribution = s; - } else { + if (s.startsWith("uri:") || s.startsWith("properties:")) { domainURI = s; + } else { + contribution = s; } } } @@ -466,6 +465,10 @@ public class Shell { return true; } + boolean status() { + return true; + } + boolean history() { for (String l : history) out.println(l); @@ -608,6 +611,12 @@ public class Shell { return started(toks); } }; + if (op.equalsIgnoreCase("status")) + return new Callable() { + public Boolean call() { + return status(); + } + }; if (op.equalsIgnoreCase("history")) return new Callable() { public Boolean call() { @@ -679,6 +688,8 @@ public class Shell { helpStop(); } else if ("startup".equalsIgnoreCase(command)) { helpStartUp(); + } else if ("status".equalsIgnoreCase(command)) { + helpStatus(); } else if ("services".equalsIgnoreCase(command)) { helpServices(); } else if ("bye".equalsIgnoreCase(command)) { @@ -711,6 +722,7 @@ public class Shell { out.println(" start |"); out.println(" start [] [-duris ]"); out.println(" started [ []]"); + out.println(" status"); out.println(" stop [ []]"); out.println(" bye"); out.println(); @@ -881,6 +893,16 @@ public class Shell { out.println(" compositeUri - (optional) the URI of a composite"); } + void helpStatus() { + out.println(" status"); + out.println(); + out.println(" Shows the status of the Shell including information on the known domains,"); + out.println(" installed contributions, and started composites"); + out.println(); + out.println(" Arguments:"); + out.println(" none"); + } + void helpStop() { out.println(" stop [ []]"); out.println(" stop "); -- cgit v1.2.3