trait SexyOpt extends AnyRef
Mix-in this trait to define the command line options and arguments that your application takes.
- Alphabetic
- By Inheritance
- SexyOpt
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Type Members
Abstract Value Members
Concrete Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##(): Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native() @HotSpotIntrinsicCandidate()
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- 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
--helpfor more information) to stderr and exits the process with exit code 1. - 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
--helpmessage- returns
trueif the flag has been used andfalseotherwise
- 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
--helpmessage- returns
trueif the flag has been used andfalseotherwise
- implicit def getArgumentValue[T](arg: Argument[T]): T
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- 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
--helpmessage- returns
the argument provided by the user wrapped in a
SomeorNoneif the user did not use this option
- 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
--helpmessage- default
the value that is used when the user does not use this option
- returns
the argument provided by the user or
defaultif the user did not use this option
- 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
--helpmessage- returns
the argument provided by the user wrapped in a
SomeorNoneif the user did not use this option
- 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
--helpmessage- default
the value that is used when the user does not use this option
- returns
the argument provided by the user or
defaultif the user did not use this option
- val optionDescriptionOffset: Int
Override this to change the start of the second column in the
--helpmessage - val optionIndentation: Int
Override this to change the indentation of the options in the
--helpmessage - 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
--helpmessage- description
the description that will be displayed for this argument in the
--helpmessage- returns
the argument provided by the user wrapped in a
Someif there is one orNoneotherwise
- 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
--helpmessage- description
the description that will be displayed for this argument in the
--helpmessage- 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
defaultotherwise
- def parse(args: Array[String]): Unit
Parses the given list of command line arguments and sets the defined arguments accordingly.
- 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
--helpmessage- description
the description that will be displayed for this argument in the
--helpmessage- returns
the argument provided by the user
- 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
--helpmessage- description
the description that will be displayed for this argument in the
--helpmessage- atLeastOne
falseif no arguments may be provided,trueif at least one has to be provided- returns
the argument provided by the user if there is one or
defaultotherwise
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- val totalLength: Int
Override this to change the width at which the
--helpmessage is wrapped (not currently implemented) - val version: Option[String]
Override this to set a version number that can be printed using --version
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
Deprecated Value Members
- 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.