All Downloads are FREE. Search and download functionalities are using the official Maven repository.

de.halcony.argparse.parsing.DefaultArgument.scala Maven / Gradle / Ivy

Go to download

A re-imagined implementation of the handy python-argparse functionality for scala

There is a newer version: 2.0.3
Show newest version
package de.halcony.argparse.parsing

import de.halcony.argparse.ParsingResult

case class DefaultArgument[T] protected (override val name: String,
                                         value: T,
                                         override val description: String = "")
    extends BaseArgument(name, description) {

  override def parse(cmd: Iterable[String])(
      implicit pargv: ParsingResult): Iterable[String] = {
    pargv.addResult(name, ResultValue[T](value))
    cmd
  }

}

object DefaultArgument {

  def apply[T](name: String, value: T): DefaultArgument[T] = {
    new DefaultArgument[T](name, value)
  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy