Created
January 13, 2016 00:42
-
-
Save gregsymons/c582a51c9b31815bd402 to your computer and use it in GitHub Desktop.
How I would format the "command" example for scopt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cmd("update"). | |
action { (_, c) => c.copy(mode = "update") }. | |
text("update is a command."). | |
children( | |
opt[Unit]("not-keepalive"). | |
abbr("nk"). | |
action { (_, c) => c.copy(keepalive = false) }. | |
text("disable keepalive"), | |
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 | |
} | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment