diff --git a/src/main/kotlin/com/beust/kobalt/Args.kt b/src/main/kotlin/com/beust/kobalt/Args.kt index 55633bbc..1ba48060 100644 --- a/src/main/kotlin/com/beust/kobalt/Args.kt +++ b/src/main/kotlin/com/beust/kobalt/Args.kt @@ -7,7 +7,7 @@ class Args { var targets: List = 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 diff --git a/src/main/kotlin/com/beust/kobalt/Main.kt b/src/main/kotlin/com/beust/kobalt/Main.kt index 484b33ef..eacf21d2 100644 --- a/src/main/kotlin/com/beust/kobalt/Main.kt +++ b/src/main/kotlin/com/beust/kobalt/Main.kt @@ -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()