Workflow stats - command added 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/41ddbd65 Tree: http://git-wip-us.apache.org/repos/asf/incubator-taverna-language/tree/41ddbd65 Diff: http://git-wip-us.apache.org/repos/asf/incubator-taverna-language/diff/41ddbd65
Branch: refs/heads/master Commit: 41ddbd65ce97041e13418487c0bb03a560e4e060 Parents: bebd11b Author: Menaka Madushanka <[email protected]> Authored: Tue Jun 30 03:22:46 2015 +0530 Committer: Menaka Madushanka <[email protected]> Committed: Tue Jun 30 03:22:46 2015 +0530 ---------------------------------------------------------------------- .../apache/taverna/tavlang/CommandLineTool.java | 38 +++++++++++++++++--- 1 file changed, 33 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-taverna-language/blob/41ddbd65/taverna-language-commandline/src/main/java/org/apache/taverna/tavlang/CommandLineTool.java ---------------------------------------------------------------------- diff --git a/taverna-language-commandline/src/main/java/org/apache/taverna/tavlang/CommandLineTool.java b/taverna-language-commandline/src/main/java/org/apache/taverna/tavlang/CommandLineTool.java index cda9ba7..4a50489 100644 --- a/taverna-language-commandline/src/main/java/org/apache/taverna/tavlang/CommandLineTool.java +++ b/taverna-language-commandline/src/main/java/org/apache/taverna/tavlang/CommandLineTool.java @@ -56,11 +56,12 @@ public class CommandLineTool { CliBuilder<TvnLangTool> build = Cli.<TvnLangTool> builder("tavlang") .withDescription("Convert, manage workflows") .withDefaultCommand(HelpCommand.class) - .withCommand(CommandConvert.class) - .withCommand(HelpCommand.class) - .withCommand(CommandInspect.class) - .withCommand(CommandValidate.class) - .withCommand(CommandVersion.class); + .withCommand(CommandConvert.class) // Conversion + .withCommand(HelpCommand.class) // Help + .withCommand(CommandInspect.class) // Inspect + .withCommand(CommandValidate.class) // Validate + .withCommand(CommandVersion.class) // Version + .withCommand(CommandStat.class); // Statistics return build.build(); } @@ -320,5 +321,32 @@ public class CommandLineTool { } } + + //Command for getting workflow stats + @Command (name = "stats", description = "Shows the workflow statistics") + public static class CommandStat extends TvnLangTool{ + + @Option(name={"-wf", "--workflow"}, description ="Specify the input is workflow file or bundle") + public boolean isWf; + + @Option(name = {"-l", "--log"}, description="Save the workflow statictics in a file") + public String file; + + @Arguments(usage="option> <input files", description = "Enter the workflow bundles/ files") + public List<String> files; + + @Override + public void execute() { + // TODO Auto-generated method stub + File f = new File(file); + + if(!f.isFile()){ + System.out.println("Invalid argument...." + " " + file); + TvnLangTool command = parser().parse("help", "validate"); + command.execute(); + } + } + + } }
