You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@taverna.apache.org by st...@apache.org on 2016/02/10 12:00:24 UTC
incubator-taverna-language git commit: run convert command,
even if not --validate
Repository: incubator-taverna-language
Updated Branches:
refs/heads/master 79fdfae56 -> f24046d60
run convert command, even if not --validate
Project: http://git-wip-us.apache.org/repos/asf/incubator-taverna-language/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-taverna-language/commit/f24046d6
Tree: http://git-wip-us.apache.org/repos/asf/incubator-taverna-language/tree/f24046d6
Diff: http://git-wip-us.apache.org/repos/asf/incubator-taverna-language/diff/f24046d6
Branch: refs/heads/master
Commit: f24046d606e0552f87cfc61356c6bd465a59d7c6
Parents: 79fdfae
Author: Stian Soiland-Reyes <st...@apache.org>
Authored: Wed Feb 10 11:00:01 2016 +0000
Committer: Stian Soiland-Reyes <st...@apache.org>
Committed: Wed Feb 10 11:00:01 2016 +0000
----------------------------------------------------------------------
.../apache/taverna/tavlang/CommandLineTool.java | 59 ++++++++++----------
1 file changed, 29 insertions(+), 30 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-taverna-language/blob/f24046d6/taverna-tavlang-tool/src/main/java/org/apache/taverna/tavlang/CommandLineTool.java
----------------------------------------------------------------------
diff --git a/taverna-tavlang-tool/src/main/java/org/apache/taverna/tavlang/CommandLineTool.java b/taverna-tavlang-tool/src/main/java/org/apache/taverna/tavlang/CommandLineTool.java
index 366ebc5..5ac8cd2 100644
--- a/taverna-tavlang-tool/src/main/java/org/apache/taverna/tavlang/CommandLineTool.java
+++ b/taverna-tavlang-tool/src/main/java/org/apache/taverna/tavlang/CommandLineTool.java
@@ -8,9 +8,9 @@ package org.apache.taverna.tavlang;
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -94,11 +94,11 @@ public class CommandLineTool {
@Option(name = "--json", description = "Convert the workflow into json")
public static boolean isJson = false;
-
+
@Option(name = "--iwir", description = "Convert scufl2 workflows into IWIR 1.1 specification")
public static boolean isIwir = false;
-
-
+
+
// The tool can only handle one output format at a time.
// Return the file type which is selected
public static String isTrue() {
@@ -112,18 +112,18 @@ public class CommandLineTool {
return "structure";
else if (isJson)
return "json";
-
+
else if (isIwir)
return "iwir";
-
-
+
+
else{
System.out.println("Invalid argument....");
TvnLangTool command = parser().parse("help", "convert");
command.execute();
return null;
}
-
+
}
}
@@ -145,9 +145,9 @@ public class CommandLineTool {
TvnLangTool command = parser().parse("help", "inspect");
command.execute();
return null;
-
+
}
-
+
}
}
@@ -208,19 +208,18 @@ public class CommandLineTool {
@Override
public void execute() {
-
+
//Validate before convert
if(validate){
Validate validate = new Validate(files, null, false);
if(validate.getCheck()){
System.out.println("Conversion failed...! Workflow bundle has errors");
return;
- }else{
- runcommand();
}
}
+ runcommand();
}
-
+
public void runcommand(){
if (Filetypes.isRo) {
try {
@@ -244,9 +243,9 @@ public class CommandLineTool {
}
}
-
-
-
+
+
+
}
// Version command
@@ -303,10 +302,10 @@ public class CommandLineTool {
// Command for validation
@Command(name = "validate", description = "Validate the given workflow")
public static class CommandValidate extends TvnLangTool{
-
+
@Option(name = { "-l", "--log" }, description = "Specify the file name where results should be stored ([some dir]/log.txt)")
public String file;
-
+
@Option(name = {"-v", "--verbose"}, description = "Verbose mode")
public boolean verbose;
@@ -316,35 +315,35 @@ public class CommandLineTool {
@Override
public void execute() {
-
+
Validate validate = new Validate(toValidate, file, verbose);
-
+
}
}
-
+
//Command for getting workflow stats
@Command (name = "stats", description = "Shows the workflow statistics")
public static class CommandStat extends TvnLangTool{
-
+
@Option(name = {"-l", "--log"}, description ="Save the workflow statistics in a file")
public String file;
-
+
@Option(name = {"-v", "--verbose"}, description = "Verbose mode")
public boolean verbose;
-
+
@Arguments(usage="input files", description = "Enter the workflow bundle files")
public List<String> files;
-
+
@Override
public void execute() {
-
+
GetWfStat stat = new GetWfStat(files, file, verbose);
-
+
}
-
+
}
}