Commit 7bd5c5b1 authored by Wai Yi Leung's avatar Wai Yi Leung
Browse files

Adding descriptive help to the commandline help

parent 17c5de32
...@@ -24,6 +24,7 @@ import org.broadinstitute.gatk.utils.commandline.Input ...@@ -24,6 +24,7 @@ import org.broadinstitute.gatk.utils.commandline.Input
import org.fusesource.scalate.{ TemplateEngine, TemplateSource } import org.fusesource.scalate.{ TemplateEngine, TemplateSource }
import scala.collection.mutable import scala.collection.mutable
import scala.language.postfixOps
/** /**
* This trait is meant to make an extension for a report object * This trait is meant to make an extension for a report object
...@@ -66,15 +67,28 @@ trait ReportBuilderExtension extends ToolCommandFunction { ...@@ -66,15 +67,28 @@ trait ReportBuilderExtension extends ToolCommandFunction {
trait ReportBuilder extends ToolCommand { trait ReportBuilder extends ToolCommand {
case class Args(summary: File = null, outputDir: File = null, pageArgs: mutable.Map[String, Any] = mutable.Map()) extends AbstractArgs case class Args(summary: File = null,
outputDir: File = null,
pageArgs: mutable.Map[String, Any] = mutable.Map()) extends AbstractArgs
class OptParser extends AbstractOptParser { class OptParser extends AbstractOptParser {
head(
s"""
|$commandName - Generate HTML formatted report from a biopet summary.json
""".stripMargin
)
opt[File]('s', "summary") unbounded () required () maxOccurs 1 valueName "<file>" action { (x, c) => opt[File]('s', "summary") unbounded () required () maxOccurs 1 valueName "<file>" action { (x, c) =>
c.copy(summary = x) c.copy(summary = x)
} } validate {
x => if (x.exists) success else failure("Summary JSON file not found!")
} text "Biopet summary JSON file"
opt[File]('o', "outputDir") unbounded () required () maxOccurs 1 valueName "<file>" action { (x, c) => opt[File]('o', "outputDir") unbounded () required () maxOccurs 1 valueName "<file>" action { (x, c) =>
c.copy(outputDir = x) c.copy(outputDir = x)
} } text "Output HTML report files to this directory"
opt[Map[String, String]]('a', "args") unbounded () action { (x, c) => opt[Map[String, String]]('a', "args") unbounded () action { (x, c) =>
c.copy(pageArgs = c.pageArgs ++ x) c.copy(pageArgs = c.pageArgs ++ x)
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment