Class

com.fulcrumgenomics.sopt.cmdline

CommandLineProgramParser

Related Doc: package cmdline

Permalink

class CommandLineProgramParser[T] extends CommandLineParserStrings with LazyLogging

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.

Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. CommandLineProgramParser
  2. LazyLogging
  3. CommandLineParserStrings
  4. AnyRef
  5. Any
Implicitly
  1. by any2stringadd
  2. by StringFormat
  3. by Ensuring
  4. by ArrowAssoc
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new CommandLineProgramParser(targetClass: Class[T], includeSpecialArgs: Boolean = true)

    Permalink

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. def +(other: String): String

    Permalink
    Implicit information
    This member is added by an implicit conversion from CommandLineProgramParser[T] to any2stringadd[CommandLineProgramParser[T]] performed by method any2stringadd in scala.Predef.
    Definition Classes
    any2stringadd
  4. def ->[B](y: B): (CommandLineProgramParser[T], B)

    Permalink
    Implicit information
    This member is added by an implicit conversion from CommandLineProgramParser[T] to ArrowAssoc[CommandLineProgramParser[T]] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc
    Annotations
    @inline()
  5. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  6. val ArgumentsSuffix: String

    Permalink
    Definition Classes
    CommandLineParserStrings
  7. val AvailableSubCommands: String

    Permalink

    Error messages

    Error messages

    Definition Classes
    CommandLineParserStrings
  8. val HelpSimilarityFloor: Int

    Permalink

    Similarity floor for when searching for similar sub-command names.

    Similarity floor for when searching for similar sub-command names. *

    Definition Classes
    CommandLineParserStrings
  9. val MinimumSubstringLength: Int

    Permalink
    Definition Classes
    CommandLineParserStrings
  10. val MissingSubCommand: String

    Permalink
    Definition Classes
    CommandLineParserStrings
  11. val SeparatorLine: String

    Permalink

    Section separator

    Section separator

    Definition Classes
    CommandLineParserStrings
  12. val SubCommandDescriptionLineLength: Int

    Permalink

    The maximum line lengths for tool descriptions

    The maximum line lengths for tool descriptions

    Definition Classes
    CommandLineParserStrings
  13. val SubCommandGroupDescriptionColumnLength: Int

    Permalink
    Definition Classes
    CommandLineParserStrings
  14. val SubCommandGroupNameColumnLength: Int

    Permalink

    Lengths for names and descriptions on the command line

    Lengths for names and descriptions on the command line

    Definition Classes
    CommandLineParserStrings
  15. val SubCommandNameColumnLength: Int

    Permalink
    Definition Classes
    CommandLineParserStrings
  16. val UsagePrefix: String

    Permalink

    Section headers

    Section headers

    Definition Classes
    CommandLineParserStrings
  17. val argumentLookup: ClpArgumentLookup

    Permalink
  18. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  19. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  20. def commandLine(): String

    Permalink

    Gets the command line assuming parseTasks has been called

  21. def commandLineName: String

    Permalink

    The command line name.

    The command line name.

    Definition Classes
    CommandLineProgramParserCommandLineParserStrings
  22. def ensuring(cond: (CommandLineProgramParser[T]) ⇒ Boolean, msg: ⇒ Any): CommandLineProgramParser[T]

    Permalink
    Implicit information
    This member is added by an implicit conversion from CommandLineProgramParser[T] to Ensuring[CommandLineProgramParser[T]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  23. def ensuring(cond: (CommandLineProgramParser[T]) ⇒ Boolean): CommandLineProgramParser[T]

    Permalink
    Implicit information
    This member is added by an implicit conversion from CommandLineProgramParser[T] to Ensuring[CommandLineProgramParser[T]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  24. def ensuring(cond: Boolean, msg: ⇒ Any): CommandLineProgramParser[T]

    Permalink
    Implicit information
    This member is added by an implicit conversion from CommandLineProgramParser[T] to Ensuring[CommandLineProgramParser[T]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  25. def ensuring(cond: Boolean): CommandLineProgramParser[T]

    Permalink
    Implicit information
    This member is added by an implicit conversion from CommandLineProgramParser[T] to Ensuring[CommandLineProgramParser[T]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  26. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  27. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  28. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  29. def formatShortDescription(description: String): String

    Permalink

    Formats the short description of a tool when printing out the list of sub-commands in the usage.

    Formats the short description of a tool when printing out the list of sub-commands in the usage.

    (1) find the first period (".") and keep only everything before it (2) shorten it to the maximum line length adding "..." to the end.

    Definition Classes
    CommandLineParserStrings
  30. def formatted(fmtstr: String): String

    Permalink
    Implicit information
    This member is added by an implicit conversion from CommandLineProgramParser[T] to StringFormat[CommandLineProgramParser[T]] performed by method StringFormat in scala.Predef.
    Definition Classes
    StringFormat
    Annotations
    @inline()
  31. def genericClpNameOnCommandLine: String

    Permalink

    The name of "command" on the command line

    The name of "command" on the command line

    Definition Classes
    CommandLineParserStrings
  32. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  33. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  34. val includeSpecialArgs: Boolean

    Permalink
  35. var instance: Option[T]

    Permalink

    The instance of type T that is None initially, and will be populated with a T after a successful parse().

  36. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  37. lazy val logger: Logger

    Permalink
    Attributes
    protected
    Definition Classes
    LazyLogging
  38. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  39. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  40. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  41. def parseAndBuild(args: Seq[String]): ParseResult

    Permalink

    Parses the command line arguments for a given class and attempts to instantiate the class.

    Parses the command line arguments for a given class and attempts to instantiate the class. Appends any errors to the stringBuilder if parsing is unsuccessful.

    args

    the args to parse.

    returns

    an instance of the class T if we successfully parsed the args, false otherwise

  42. def standardCommandAndSubCommandUsagePreamble(commandClazz: Option[Class[_]] = None, subCommandClazz: Option[Class[_]] = None): String

    Permalink

    A typical command line program will call this to get the beginning of the usage message, and then append a description of the program.

    A typical command line program will call this to get the beginning of the usage message, and then append a description of the program.

    Definition Classes
    CommandLineParserStrings
  43. def standardSubCommandUsagePreamble(clazz: Option[Class[_]] = None): String

    Permalink

    A typical command line program will call this to get the beginning of the usage message, and then append a description of the program.

    A typical command line program will call this to get the beginning of the usage message, and then append a description of the program.

    Definition Classes
    CommandLineParserStrings
  44. def standardUsagePreamble: String

    Permalink

    A typical command line program will call this to get the beginning of the usage message, and then append a description of the program, like this:

    A typical command line program will call this to get the beginning of the usage message, and then append a description of the program, like this:

    Attributes
    protected
  45. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  46. val targetClass: Class[T]

    Permalink
  47. def targetName: String

    Permalink
    Attributes
    protected
  48. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  49. def usage(withVersion: Boolean = true, withSpecial: Boolean = true): String

    Permalink

    Print a usage message for a given command line task.

    Print a usage message for a given command line task.

    withVersion

    include the version in the standard preamble.

    withSpecial

    include command line arguments marked as special.

  50. def version: String

    Permalink
  51. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  52. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  53. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  54. def [B](y: B): (CommandLineProgramParser[T], B)

    Permalink
    Implicit information
    This member is added by an implicit conversion from CommandLineProgramParser[T] to ArrowAssoc[CommandLineProgramParser[T]] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc

Inherited from LazyLogging

Inherited from CommandLineParserStrings

Inherited from AnyRef

Inherited from Any

Inherited by implicit conversion any2stringadd from CommandLineProgramParser[T] to any2stringadd[CommandLineProgramParser[T]]

Inherited by implicit conversion StringFormat from CommandLineProgramParser[T] to StringFormat[CommandLineProgramParser[T]]

Inherited by implicit conversion Ensuring from CommandLineProgramParser[T] to Ensuring[CommandLineProgramParser[T]]

Inherited by implicit conversion ArrowAssoc from CommandLineProgramParser[T] to ArrowAssoc[CommandLineProgramParser[T]]

Ungrouped