Object

com.carlosedp.scalautils

ParseArguments

Related Doc: package scalautils

Permalink

object ParseArguments

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

Value Members

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

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

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

    Permalink
    Definition Classes
    AnyRef → Any
  4. def apply(args: Array[String], parameters: List[String], paramFormat: String = "-"): (Map[String, String], Array[String])

    Permalink

    Parses command line arguments

    Parses command line arguments

    This function parses command line arguments from args, as an Array[String]. The parameters to be extracted can be prefixed with - as default or the param prefix in paramFormat (for example --) and passed in parameters as List[String].

    The function returns a Map[String, String] with extracted parameters and a List[String] with remaining arguments that were not extracted. The parameter name is returned with it's leading paramFormat ("-" for example) removed.

    If a parameter does not contain a value and is followed with another parameter (with same prefix), it is ignored.

    Usage:

    // Received args
    val args = Array( "-param1", "-wrong", "generated", "singleparam1", "singleparam2", "-anotherparam", "mydata", "-param2", "myboard" )
    // Parsing parameters
    val (params, remaininglargs) = ParseArguments(args, List("param1", "param2"))

    Results:

    Map("param2" -> "myboard")
    Array("-wrong", "generated", "singleparam1", "singleparam2", "-anotherparam", "mydata")
    args

    the input arguments

    parameters

    the parameters to be extracted from input args.

    paramFormat

    the param prefix to be extracted (Eg. - or --).

    returns

    a Map[String,String] with extracted params and an Array[String] with remaining arguments.

  5. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  6. def clone(): AnyRef

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

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

    Permalink
    Definition Classes
    AnyRef → Any
  9. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
    Annotations
    @HotSpotIntrinsicCandidate()
  10. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
    Annotations
    @HotSpotIntrinsicCandidate()
  11. final def isInstanceOf[T0]: Boolean

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

    Permalink
    Definition Classes
    AnyRef
  13. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @HotSpotIntrinsicCandidate()
  14. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @HotSpotIntrinsicCandidate()
  15. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  16. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  17. final def wait(arg0: Long, arg1: Int): Unit

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  19. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Deprecated Value Members

  1. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @Deprecated @deprecated @throws( classOf[java.lang.Throwable] )
    Deprecated

    (Since version ) see corresponding Javadoc for more information.

Inherited from AnyRef

Inherited from Any

Ungrouped