Package

com.fulcrumgenomics.sopt

cmdline

Permalink

package cmdline

Visibility
  1. Public
  2. All

Type Members

  1. class ArgAnnotation extends Annotation with Annotation with ClassfileAnnotation

    Permalink
  2. case class BadAnnotationException(msg: String, e: Option[Exception] = None) extends CommandLineException with Product with Serializable

    Permalink

    Exception thrown when something the annotation on a field is incorrect.

  3. case class BadArgumentValue(msg: String, e: Option[Exception] = None) extends CommandLineException with Product with Serializable

    Permalink

    Exception thrown when something the user gives a bad value

  4. class ClpAnnotation extends Annotation with Annotation with ClassfileAnnotation

    Permalink
  5. trait ClpGroup extends Ordered[ClpGroup]

    Permalink

    Trait for groups of CommandLinePrograms.

  6. class ClpReflectiveBuilder[T] extends ReflectiveBuilder[T]

    Permalink

    Extends ReflectiveBuilder to add support for the arguments annotated with the arg annotation and to use more specific logic to find the appropriate constructor to use to instantiate command line programs.

    Extends ReflectiveBuilder to add support for the arguments annotated with the arg annotation and to use more specific logic to find the appropriate constructor to use to instantiate command line programs.

    T

    the type for the class

  7. class Clps extends ClpGroup

    Permalink

    The program group for the command line programs.

  8. class CommandLineException extends RuntimeException

    Permalink

    Base class for all exceptions thrown by the command line parsing

  9. class CommandLineParser[SubCommand] extends CommandLineParserStrings

    Permalink

    Class for parsing the command line when we also have sub-commands.

    Class for parsing the command line when we also have sub-commands.

    We have two possible entry points: (1) parseSubCommand() for when we have set of sub-commands, each having their own set of arguments, and we use the first argument to get the class's simple name (getSimpleName), and pass the rest of the arguments to a properly instantiated CommandLineProgramParser to parse the arguments and build an instance of that class. (2) parseCommandAndSubCommand for the same case as (1), but when the main program itself also has arguments, which come prior to the name of the command line program.

    To route the arguments to build the appropriate program, the parser searches for a command line program that is a sub-class of SubCommand, and creates a CommandLineProgramParser to parse the args and return an instance of the SubCommand.

    Constructor arguments for the sub-command classes or command class can be annotated with com.fulcrumgenomics.sopt.arg while constructors themselves can be annotated with clp. The latter may be omitted, but is extremely useful for grouping related sub-commands and having a common description.

    SubCommand

    the base class for all sub-commands to display and parse on the command line.

  10. case class CommandLineParserInternalException(msg: String, e: Option[Exception] = None) extends CommandLineException with Product with Serializable

    Permalink

    Exception thrown when something internally goes wrong with command line parsing

  11. trait CommandLineParserStrings extends AnyRef

    Permalink

    Various constants and methods for formatting and printing usages and error messages on the command line

  12. class CommandLineProgramParser[T] extends CommandLineParserStrings with LazyLogging

    Permalink

    Class for parsing the command line for a single command line program.

    Class for parsing the command line for a single command line program.

    The main entry point is parseAndBuild(). The arguments given to this method should match the annotated arguments to the program's constructor. Constructor arguments can be annotated with com.fulcrumgenomics.sopt.arg while constructors themselves can be annotated with com.fulcrumgenomics.sopt.clp. The latter may be omitted, but is useful for grouping related command line programs and having a common description.

  13. case class MissingAnnotationException(msg: String, e: Option[Exception] = None) extends CommandLineException with Product with Serializable

    Permalink

    Exception thrown when the user forgets to specify an annotation

  14. case class MissingArgumentException(msg: String, e: Option[Exception] = None) extends CommandLineException with Product with Serializable

    Permalink

    Exception thrown when the user forgets to specify an argument

  15. case class ParseFailure(ex: Exception, remaining: Traversable[String]) extends ParseResult with Product with Serializable

    Permalink

    Class that indicates a failure in parsing.

    Class that indicates a failure in parsing. An exception and the remaining arguments, if applicable, are provied.

  16. case class ParseHelp() extends ParseResult with Product with Serializable

    Permalink

    Class that indicates a help option was found.

  17. sealed abstract class ParseResult extends AnyRef

    Permalink
  18. case class ParseSuccess() extends ParseResult with Product with Serializable

    Permalink

    Class that indicates a successful parsing.

  19. case class ParseVersion() extends ParseResult with Product with Serializable

    Permalink

    Class that indicates a version option was found.

  20. case class UserException(msg: String, e: Option[Exception] = None) extends CommandLineException with Product with Serializable

    Permalink

    Exception thrown when something there is user error (never happens)

  21. case class ValidationException(messages: List[String]) extends RuntimeException with Product with Serializable

    Permalink

    Exception class that is intended to be used to signal one or more validation errors in command line program constructors, and provide useful messages back to the user.

  22. case class ValueConversionException(msg: String, e: Option[Exception] = None) extends CommandLineException with Product with Serializable

    Permalink

    Exception thrown when trying to convert to specific value

Value Members

  1. object ClpArgumentDefinitionPrinting

    Permalink
  2. object CommandLineException extends Serializable

    Permalink
  3. object CommandLineProgramParserStrings

    Permalink

    Stores strings used in the usage and error messages

Ungrouped