com.twitter.app

Flags

class Flags extends AnyRef

A simple flags implementation. We support only two formats:

for flags with optional values (booleans): -flag, -flag=value for flags with required values: -flag[= ]value

That's it. These can be parsed without ambiguity.

There is no support for mandatory arguments: That is not what flags are for.

Flags' apply adds a new flag to to the flag set, so it is idiomatic to assign instances of Flags to a singular flag:

val flag = new Flags("myapp")
val i = flag("i", 123, "iteration count")

Global flags, detached from a particular Flags instance, but accessible to all, are defined by com.twitter.app.GlobalFlag.

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Flags
  2. AnyRef
  3. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Flags(argv0: String)

  2. new Flags(argv0: String, includeGlobal: Boolean)

Value Members

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

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

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

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

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

    Definition Classes
    Any
  6. def add(f: Flag[_]): Unit

  7. def apply[T](name: String, help: String)(implicit _f: Flaggable[T], m: Manifest[T]): Flag[T]

  8. def apply[T](name: String, default: ⇒ T, help: String)(implicit arg0: Flaggable[T]): Flag[T]

  9. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  10. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  11. final def eq(arg0: AnyRef): Boolean

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

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

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  14. def formattedFlagValues(includeGlobal: Boolean = this.includeGlobal, classLoader: ClassLoader = this.getClass.getClassLoader): (Iterable[String], Iterable[String])

    Formats all the values of all flags known to this instance into a format suitable for logging

    Formats all the values of all flags known to this instance into a format suitable for logging

    includeGlobal

    see getAll above

    classLoader

    see getAll above

    returns

    all the flag values in alphabetical order, grouped into (set, unset)

  15. def formattedFlagValuesString(includeGlobal: Boolean = this.includeGlobal, classLoader: ClassLoader = this.getClass.getClassLoader): String

    Creates a string containing all the values of all flags known to this instance into a format suitable for logging

    Creates a string containing all the values of all flags known to this instance into a format suitable for logging

    includeGlobal

    set getAll above

    classLoader

    set getAll above

    returns

    A string suitable for logging

  16. def getAll(includeGlobal: Boolean = this.includeGlobal, classLoader: ClassLoader = this.getClass.getClassLoader): Iterable[Flag[_]]

    Get all the flags known to this this Flags instance

    Get all the flags known to this this Flags instance

    includeGlobal

    defaults to the includeGlobal settings of this instance

    classLoader

    needed to find global flags, defaults to this instance's class loader

    returns

    all the flags known to this this Flags instance

  17. final def getClass(): Class[_]

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

    Definition Classes
    AnyRef → Any
  19. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  20. final def ne(arg0: AnyRef): Boolean

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

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

    Definition Classes
    AnyRef
  23. def parse(args: Array[String], undefOk: Boolean = false): Seq[String]

  24. def reset(): Unit

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

    Definition Classes
    AnyRef
  26. def toString(): String

    Definition Classes
    AnyRef → Any
  27. def usage: String

  28. final def wait(): Unit

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws()

Inherited from AnyRef

Inherited from Any

Ungrouped