Releases: alexarchambault/case-app
Releases · alexarchambault/case-app
v2.0.5
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
to1.5.0
v2.0.4
New features
- Add
ArgParser
forcats.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
v2.0.2
- Fix regresion in
caseapp.CaseApp
, that was not callingrun
when the parsing of argument succeeded (regression in2.0.1
)
v2.0.1
v2.0.0
- Update scala to
2.12.11
,2.13.2
- Update Scala.JS to
1.1.0
v2.0.0-M16
v2.0.0-M15
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>
v2.0.0-M14
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
- Ensure allowing to stop parsing at first argument (introduced in
2.0.0-M12
) works fine when using commands