Packages

t

sexyopt

SexyOpt

trait SexyOpt extends AnyRef

Mix-in this trait to define the command line options and arguments that your application takes.

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. SexyOpt
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Type Members

  1. class Argument[T] extends AnyRef

    A value provided by the user as a command line option or argument.

    A value provided by the user as a command line option or argument. Do not use until parse has been called.

Abstract Value Members

  1. abstract def programDescription: String

    The description of this program that is displayed in the --help message

  2. abstract def programName: String

    The name of this program as displayed in the usage section of the --help message

Concrete Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native() @HotSpotIntrinsicCandidate()
  6. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  7. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  8. def failWith(message: String): Nothing

    Override this to change what happens when the given command line is not valid (for example because arguments are missing or there are too many).

    Override this to change what happens when the given command line is not valid (for example because arguments are missing or there are too many).

    By default this displays the given message (plus a reminder to use --help for more information) to stderr and exits the process with exit code 1.

  9. def flag(longName: String, description: String): Argument[Boolean]

    Adds a flag (option without an argument).

    Adds a flag (option without an argument).

    longName

    the long name of the flag. The flag can be activated via --longName

    description

    the description that will be displayed for this flag in the --help message

    returns

    true if the flag has been used and false otherwise

  10. def flag(longName: String, shortName: Char, description: String): Argument[Boolean]

    Adds a flag (option without an argument).

    Adds a flag (option without an argument).

    longName

    the long name of the flag. The flag can be activated via --longName

    shortName

    the single-character name of the flag. The flag can be activated via -shortName

    description

    the description that will be displayed for this flag in the --help message

    returns

    true if the flag has been used and false otherwise

  11. implicit def getArgumentValue[T](arg: Argument[T]): T
  12. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  13. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  14. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  15. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  16. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  17. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  18. def option(longName: String, description: String): Argument[Option[String]]

    Adds an option with an argument.

    Adds an option with an argument. The option's argument will be the token that follows the option on the command line.

    longName

    the long name of the option. The option can be activated via --longName argument

    description

    the description that will be displayed for this option in the --help message

    returns

    the argument provided by the user wrapped in a Some or None if the user did not use this option

  19. def option(longName: String, description: String, default: String): Argument[String]

    Adds an option with an argument.

    Adds an option with an argument. The option's argument will be the token that follows the option on the command line.

    longName

    the long name of the option. The option can be activated via --longName argument

    description

    the description that will be displayed for this option in the --help message

    default

    the value that is used when the user does not use this option

    returns

    the argument provided by the user or default if the user did not use this option

  20. def option(longName: String, shortName: Char, description: String): Argument[Option[String]]

    Adds an option with an argument.

    Adds an option with an argument. The option's argument will be the token that follows the option on the command line.

    longName

    the long name of the option. The option can be activated via --longName argument

    shortName

    the single-character name of the option. The option can be activated via -shortName argument

    description

    the description that will be displayed for this option in the --help message

    returns

    the argument provided by the user wrapped in a Some or None if the user did not use this option

  21. def option(longName: String, shortName: Char, description: String, default: String): Argument[String]

    Adds an option with an argument.

    Adds an option with an argument. The option's argument will be the token that follows the option on the command line.

    longName

    the long name of the option. The option can be activated via --longName argument

    shortName

    the single-character name of the option. The option can be activated via -shortName argument

    description

    the description that will be displayed for this option in the --help message

    default

    the value that is used when the user does not use this option

    returns

    the argument provided by the user or default if the user did not use this option

  22. val optionDescriptionOffset: Int

    Override this to change the start of the second column in the --help message

  23. val optionIndentation: Int

    Override this to change the indentation of the options in the --help message

  24. def optionalPosArg(name: String, description: String): Argument[Option[String]]

    Adds an optional positional argument.

    Adds an optional positional argument. The order of positional arguments will be the order in which this method is called. No other positional argument may be added after this one.

    name

    the name of this argument as it appears in the --help message

    description

    the description that will be displayed for this argument in the --help message

    returns

    the argument provided by the user wrapped in a Some if there is one or None otherwise

  25. def optionalPosArg(name: String, description: String, default: String): Argument[String]

    Adds an optional positional argument.

    Adds an optional positional argument. The order of positional arguments will be the order in which this method is called. No other positional argument may be added after this one.

    name

    the name of this argument as it appears in the --help message

    description

    the description that will be displayed for this argument in the --help message

    default

    the value that is used when the user does not use this option

    returns

    the argument provided by the user if there is one or default otherwise

  26. def parse(args: Array[String]): Unit

    Parses the given list of command line arguments and sets the defined arguments accordingly.

  27. def posArg(name: String, description: String): Argument[String]

    Adds a required positional argument.

    Adds a required positional argument. The order of positional arguments will be the order in which this method is called.

    name

    the name of this argument as it appears in the --help message

    description

    the description that will be displayed for this argument in the --help message

    returns

    the argument provided by the user

  28. def restArgs(name: String, description: String, atLeastOne: Boolean): Argument[Seq[String]]

    Eats up all remaining positional arguments.

    Eats up all remaining positional arguments. No other positional argument may be added after this one.

    name

    the name of this argument as it appears in the --help message

    description

    the description that will be displayed for this argument in the --help message

    atLeastOne

    false if no arguments may be provided, true if at least one has to be provided

    returns

    the argument provided by the user if there is one or default otherwise

  29. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  30. def toString(): String
    Definition Classes
    AnyRef → Any
  31. val totalLength: Int

    Override this to change the width at which the --help message is wrapped (not currently implemented)

  32. val version: Option[String]

    Override this to set a version number that can be printed using --version

  33. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  34. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  35. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable]) @Deprecated @deprecated
    Deprecated

    (Since version ) see corresponding Javadoc for more information.

Inherited from AnyRef

Inherited from Any

Ungrouped