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. Hide All
  2. Show all
  1. FlagOption
  2. CommandLineOption
  3. CommandLineArgument
  4. AnyRef
  5. Any
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. def != (arg0: AnyRef): Boolean

    Attributes
    final
    Definition Classes
    AnyRef
  2. def != (arg0: Any): Boolean

    Attributes
    final
    Definition Classes
    Any
  3. def ## (): Int

    Attributes
    final
    Definition Classes
    AnyRef → Any
  4. def == (arg0: AnyRef): Boolean

    Attributes
    final
    Definition Classes
    AnyRef
  5. def == (arg0: Any): Boolean

    Attributes
    final
    Definition Classes
    Any
  6. def asInstanceOf [T0] : T0

    Attributes
    final
    Definition Classes
    Any
  7. 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.

  8. def clone (): AnyRef

    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  9. 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.

  10. val description : String

    textual description of the option

    textual description of the option

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

    Attributes
    final
    Definition Classes
    AnyRef
  12. 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
  13. def finalize (): Unit

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

    Attributes
    final
    Definition Classes
    AnyRef → Any
  15. 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
  16. 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

  17. def isInstanceOf [T0] : Boolean

    Attributes
    final
    Definition Classes
    Any
  18. 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
  19. 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
  20. 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
  21. def ne (arg0: AnyRef): Boolean

    Attributes
    final
    Definition Classes
    AnyRef
  22. def notify (): Unit

    Attributes
    final
    Definition Classes
    AnyRef
  23. def notifyAll (): Unit

    Attributes
    final
    Definition Classes
    AnyRef
  24. val parent : ArgotParser

    the parent parser instance that owns the option

    the parent parser instance that owns the option

    Definition Classes
    FlagOptionCommandLineArgument
  25. 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
  26. 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.

  27. 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 "--"

  28. val supportsMultipleValues : Boolean

  29. def synchronized [T0] (arg0: ⇒ T0): T0

    Attributes
    final
    Definition Classes
    AnyRef
  30. 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
  31. def value : Option[T]

  32. def wait (): Unit

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

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

    Attributes
    final
    Definition Classes
    AnyRef
    Annotations
    @throws()

Inherited from CommandLineOption[T]

Inherited from CommandLineArgument[T]

Inherited from AnyRef

Inherited from Any