org.clapper.argot

FlagOption

class FlagOption[T] extends CommandLineOption[T]

Class for a flag. A flag option consists of a set of names that enable the flag (e.g. set it to true) if present on the command line, and a set of names that disable the flag (e.g., set it to false) if present on the command line. The type of flag option can be anything, but is generally boolean.

Linear Supertypes
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. FlagOption
  2. CommandLineOption
  3. CommandLineArgument
  4. AnyRef
  5. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new FlagOption(parent: ArgotParser, namesOn: List[String], namesOff: List[String], description: String, convert: (Boolean, FlagOption[T]) ⇒ T)

    parent

    the parent parser instance that owns the option

    namesOn

    list of names (short or long) that toggle the value on

    namesOff

    list of names (short or long) that toggle the value off

    description

    textual description of the option

    convert

    a function that takes a boolean value and maps it to the appropriate value to store as the option's value.

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 clear: Unit

    Called when the option to unset (i.

    Called when the option to unset (i.e., when one of the "off" names is seen on the command line). Subclasses may override this method. The default version calls convert() with a false and stores the result in value.

  6. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  7. val convert: (Boolean, FlagOption[T]) ⇒ T

    a function that takes a boolean value and maps it to the appropriate value to store as the option's value.

  8. val description: String

    textual description of the option

    textual description of the option

    Definition Classes
    FlagOptionCommandLineArgument
  9. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  10. def equals(o: Any): Boolean

    The standard equals() method.

    The standard equals() method.

    o

    some other object

    returns

    true if the other object is the same class and is equivalent, false if not.

    Definition Classes
    CommandLineArgument → AnyRef → Any
  11. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  12. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  13. val hasValue: Boolean

    Whether or not the argument has an associated value.

    Whether or not the argument has an associated value. For instance, parameters have values, and non-flag options have values. Flag options, however, do not.

    Definition Classes
    FlagOptionCommandLineArgument
  14. def hashCode(): Int

    Calculate the hash code for the object.

    Calculate the hash code for the object. The default implementation returns the hash code of the key.

    returns

    the hash code

    Definition Classes
    CommandLineArgument → AnyRef → Any
    See also

    #key

  15. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  16. def key: String

    Return an object that represents the key for this parameter, suitable for hashing, sorting, etc.

    Return an object that represents the key for this parameter, suitable for hashing, sorting, etc. They key for a command line option is the result of calling name().

    returns

    the key

    Attributes
    protected
    Definition Classes
    FlagOptionCommandLineOptionCommandLineArgument
  17. def name: String

    Displayable name for the argument, used in the usage message.

    Displayable name for the argument, used in the usage message.

    returns

    the name

    Definition Classes
    FlagOptionCommandLineOptionCommandLineArgument
  18. val names: List[String]

    List of option names, both long (multi-character) and short (single-character).

    List of option names, both long (multi-character) and short (single-character).

    Definition Classes
    FlagOptionCommandLineOption
  19. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  20. final def notify(): Unit

    Definition Classes
    AnyRef
  21. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  22. val parent: ArgotParser

    the parent parser instance that owns the option

    the parent parser instance that owns the option

    Definition Classes
    FlagOptionCommandLineArgument
  23. def reset(): Unit

    Resets the internal state of the argument to what it was right after construction, undoing the effects of any parse operation.

    Resets the internal state of the argument to what it was right after construction, undoing the effects of any parse operation.

    Definition Classes
    FlagOptionCommandLineArgument
  24. def set: Unit

    Called when the option is set (i.

    Called when the option is set (i.e., when one of the "on" names is seen on the command line). Subclasses may override this method. The default version calls convert() with a true, and stores the result in value.

  25. def setByName(name: String): Unit

    Set the value, based on whether the specified option name is an "on" or an "off" name.

    Set the value, based on whether the specified option name is an "on" or an "off" name.

    name

    the name, without any leading "-" or "--"

  26. val supportsMultipleValues: Boolean

  27. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  28. def toString(): String

    Get a printable name for this object.

    Get a printable name for this object.

    returns

    the printable name

    Definition Classes
    CommandLineOption → AnyRef → Any
  29. def value: Option[T]

  30. final def wait(): Unit

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from CommandLineOption[T]

Inherited from CommandLineArgument[T]

Inherited from AnyRef

Inherited from Any

Ungrouped