From 53d2233faf790bf953e53ab67a616f3985551073 Mon Sep 17 00:00:00 2001 From: magicDGS Date: Thu, 28 Sep 2017 09:26:47 +0200 Subject: [PATCH 1/3] Add CommandLineProgram interface --- .../barclay/argparser/CommandLineProgram.java | 68 +++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 src/main/java/org/broadinstitute/barclay/argparser/CommandLineProgram.java diff --git a/src/main/java/org/broadinstitute/barclay/argparser/CommandLineProgram.java b/src/main/java/org/broadinstitute/barclay/argparser/CommandLineProgram.java new file mode 100644 index 00000000..45f51848 --- /dev/null +++ b/src/main/java/org/broadinstitute/barclay/argparser/CommandLineProgram.java @@ -0,0 +1,68 @@ +package org.broadinstitute.barclay.argparser; + +/** + * Interface class to facilitate implementing command-line programs. + * + *

It should be considered as a marker interface to identify runnable Command Line Program + * classes in different toolkits, to aggregate them when looking for them. In addition, it includes + * the method {@link #instanceMain(String[])} to be call to parse the arguments and run the + * actual work. + * + *

Tool classes may want to extend this interface and {@link CommandLinePluginProvider} to + * include plugins in their command line. + * + *

Usage example: + * + *

+ * + *

Note: Barclay does not use or enforce this class for any purpose. + * + * @author Daniel Gomez-Sanchez (magicDGS) + */ +public interface CommandLineProgram { + + /** + * Implements the work to be done with the tool. + * + *

This method should implement: + * + *

+ * + *

Note: Most exceptions should be cached by the caller. + * + * @param argv arguments to pass to the {@link CommandLineParser}. + * + * @return result object after performing the work. May be {@code null}. + */ + public Object instanceMain(final String[] argv); +} From 17849c54a306ba67c99b2b5ada52c8d1e59966a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20G=C3=B3mez-S=C3=A1nchez?= Date: Fri, 29 Sep 2017 18:40:48 +0200 Subject: [PATCH 2/3] Fix typo --- .../broadinstitute/barclay/argparser/CommandLineProgram.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/org/broadinstitute/barclay/argparser/CommandLineProgram.java b/src/main/java/org/broadinstitute/barclay/argparser/CommandLineProgram.java index 45f51848..a126199d 100644 --- a/src/main/java/org/broadinstitute/barclay/argparser/CommandLineProgram.java +++ b/src/main/java/org/broadinstitute/barclay/argparser/CommandLineProgram.java @@ -58,7 +58,7 @@ public interface CommandLineProgram { *

  • Return the result of the tool.
  • * * - *

    Note: Most exceptions should be cached by the caller. + *

    Note: Most exceptions should be caught by the caller. * * @param argv arguments to pass to the {@link CommandLineParser}. * From 39716f25c1c08e86f53a0634eea5f4bae43fb472 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20G=C3=B3mez-S=C3=A1nchez?= Date: Mon, 2 Oct 2017 15:04:44 +0200 Subject: [PATCH 3/3] Fix typo --- .../broadinstitute/barclay/argparser/CommandLineProgram.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/org/broadinstitute/barclay/argparser/CommandLineProgram.java b/src/main/java/org/broadinstitute/barclay/argparser/CommandLineProgram.java index a126199d..b62017e6 100644 --- a/src/main/java/org/broadinstitute/barclay/argparser/CommandLineProgram.java +++ b/src/main/java/org/broadinstitute/barclay/argparser/CommandLineProgram.java @@ -20,7 +20,7 @@ * *

  • * Mark the class with {@link CommandLineProgramProperties} to include information for the - * tool. Users may consider to annotate with {@link BetaFeature} tools tat are in experimental + * tool. Users may consider to annotate with {@link BetaFeature} tools that are in experimental * phase. *
  • *