scala-optparse-applicative icon indicating copy to clipboard operation
scala-optparse-applicative copied to clipboard

Add example on how to use `helper` when validating arguments

Open dnadales opened this issue 9 years ago • 0 comments

Consider the following setting:

  type V[A] = ValidationNel[String, A]
  type ParserV[A] = Parser[V[A]]

implicit val ParserVInstance: Applicative[ParserV] =
       Applicative[Parser] compose Applicative[V]

 val optsParser: ParserV[Options] = ???

In this case it is not possible to compose the parsers with helper:

 execParser(args, "xxx", info(optsParser <*> helper))

It'd be nice to have an example on how helper can be used in the setting of parsers with validation.

dnadales avatar Aug 16 '16 13:08 dnadales