0
import scopt.Read.stringRead._
case class Config(
    kwargs: Map[String, Map[String, List[String]]] = Map()
)

  val parser: OptionParser[Config] = new scopt.OptionParser[Config]("test") {
    head("Test Server", "v1")
   
    opt[Map[String, Map[String, List[String]]]]("kwargs")
      .valueName("k1=v1,k2=v2...")
      .action((x, c) => c.copy(kwargs = x))
      .text("other arguments")

What would be the value name and text for it? k1=v1,k2=v2... is valid for map of string.


       .valueName(???)
          .action((x, c) => ??)
          .text("other arguments")

Avenger
  • 793
  • 11
  • 31
  • Do you want to add all values as a single parameter or append them somehow? Because it affects if you need to somehow update map with each parameter or if you need to create a custom `Read` instance. – Mateusz Kubuszok Oct 19 '20 at 09:54
  • @MateuszKubuszok all of them – Avenger Nov 02 '20 at 08:19

0 Answers0