Skip to content

Releases: alexarchambault/case-app

v2.0.5

30 Mar 13:43
4aa57b7
Compare
Choose a tag to compare

New features

Ignoring unrecognized arguments

You can now ignore unrecognized arguments, rather than failing early with a usage message. These unrecognized arguments are then passed to the application alongside values not corresponding to arguments. Enable it with:

object MyApp extends CaseApp[MyOptions] {
   override def ignoreUnrecognized = true
   def run(options: MyOptions, args: RemainingArgs): Unit = {
      // any unrecognized argument is in `args`
   }
 }

Added in #266, thanks to @gaborbarna.

Updates

  • Update Scala.JS from 1.1.1 to 1.5.0

v2.0.4

13 Aug 15:04
455cea0
Compare
Choose a tag to compare

New features

  • Add ArgParser for cats.data.NonEmptyList (#225, thanks to @YannMoisan), use like
import _root_.cats.data.NonEmptyList
import caseapp._
import caseapp.cats.CatsArgParser._

case class Args(
  value: NonEmptyList[String]
)

Updates

  • Update Scala.JS to 1.1.1

v2.0.3

25 Jun 11:33
16768ae
Compare
Choose a tag to compare
  • Add expandArgs and stopAtFirstUnrecognized support in cats module (thanks to @Slakah)

v2.0.2

24 Jun 11:00
6cf9bad
Compare
Choose a tag to compare
  • Fix regresion in caseapp.CaseApp, that was not calling run when the parsing of argument succeeded (regression in 2.0.1)

v2.0.1

16 Jun 16:07
aa91353
Compare
Choose a tag to compare
  • Add cats-effect module, thanks to @Slakah. See the README for more details.

v2.0.0

28 May 16:13
2bb86f1
Compare
Choose a tag to compare
  • Update scala to 2.12.11, 2.13.2
  • Update Scala.JS to 1.1.0

v2.0.0-M16

17 Mar 18:40
c276486
Compare
Choose a tag to compare
v2.0.0-M16 Pre-release
Pre-release

Changes

  • Small fix when using custom option formatters, introduced in 2.0.0-M15 (thanks to @regadas)

v2.0.0-M15

16 Mar 12:06
85e378a
Compare
Choose a tag to compare
v2.0.0-M15 Pre-release
Pre-release

Help / description message for apps and commands

Use like

@HelpMessage("Does something")
case class MyAppOptions(
  n: Int = 0
)

object MyApp extends CaseApp[MyAppOptions] {
  def run(options: MyAppOptions, args: RemainingArgs): Unit =
    ???
}

prints a help message like

MyApp
Does something
Usage: my-app [options]
  --usage  <bool>
        Print usage and exit
  --help | -h  <bool>
        Print help message and exit
  -n  <int>

Added in #187, thanks to @regadas.

v2.0.0-M14

14 Mar 15:40
28899aa
Compare
Choose a tag to compare
v2.0.0-M14 Pre-release
Pre-release

Add support for custom option format

Use like

object MyApp extends CaseApp[MyOptions] {

  override def nameFormatter = new Formatter[Name] {
    def format(s: Name): String =
      // Format name.name, a field name, which typically has camelCase, as you wish.
      // The default formatter converts camelCase to "kebab case" (lower case, dash separator).
      ???
  }

  def run(options: MyOptions, args: RemainingArgs): Unit = {
    ???
  }
}

Added in #186, thanks to @regadas.

Updates

  • Switch to Scala.JS 1.0
  • Switch to refined 0.9.3

v2.0.0-M13

06 Feb 01:00
9fd9a36
Compare
Choose a tag to compare
v2.0.0-M13 Pre-release
Pre-release
  • Ensure allowing to stop parsing at first argument (introduced in 2.0.0-M12) works fine when using commands