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..b62017e6 --- /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 caught 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); +}