Scopt v3.2.0 Release Notes
Release Date: 2016-06-12 // almost 8 years ago-
๐ฅ breaking changes
shorter error message
๐จ Instead of printing a wall of usage text on error, if
help("help")
option is defined, scopt 3.2.0 prints just the error message and suggests to "Try --help for more information."
โช This behavior can be reverted by overridingshowUsageOnError
.๐จ usage text prints to
Console.out
๐จ Usage text will print to
Console.out
instead ofConsole.err
when invoked as--help
. #24 reported by @Ceilican.๐ new features
hidden options
opt can now be
hidden()
.opt[Unit]("debug") hidden() action { (_, c) => c.copy(debug = true) } text("this option is hidden in the usage text")
๐ง check configuration
To check consistency among the provided
opt
values, scopt 3.2.0 introducescheckConfig
.val parser = new scopt.OptionParser[Config]("scopt") { head("scopt", "3.x") opt[Unit]('k', "keepalive") action { (x, c) => c.copy(keepalive= true) } opt[Boolean]("xyz") action { (x, c) => c.copy(xyz = x) } text("xyz is a boolean property"), checkConfig { c => if (c.keepalive && c.xyz) failure("xyz cannot keep alive") else success } help("help") text("prints this usage text") }