1
0
Fork 0
mirror of https://github.com/ethauvin/kobalt.git synced 2025-04-25 07:57:12 -07:00

Display usage when no args.

This commit is contained in:
Cedric Beust 2015-10-07 21:39:38 -07:00
parent fe8ab78bdd
commit 172e0ac6a1
2 changed files with 6 additions and 1 deletions

View file

@ -7,7 +7,7 @@ class Args {
var targets: List<String> = arrayListOf()
@Parameter(names = arrayOf("-bf", "--buildFile"), description = "The build file")
var buildFile: String? = null
var buildFile: String = "Build.kt"
@Parameter(names = arrayOf("--checkVersions"), description = "Check if there are any newer versions of the " +
"dependencies")
@ -17,6 +17,9 @@ class Args {
"actually running them")
var dryRun: Boolean = false
@Parameter(names = arrayOf("--help", "--usage"), description = "Display the help")
var usage: Boolean = false
@Parameter(names = arrayOf("-i", "--init"), description = "Create a new build file based on the current project")
var init: Boolean = false

View file

@ -109,6 +109,8 @@ private class Main @Inject constructor(
//
Wrapper().install()
ProjectGenerator().run(args)
} else if (args.usage || args.targets.isEmpty()) {
jc.usage()
} else {
if (! buildFile.exists()) {
jc.usage()