mirror of
https://github.com/ethauvin/kobalt.git
synced 2025-04-26 08:27:12 -07:00
Display usage when no args.
This commit is contained in:
parent
fe8ab78bdd
commit
172e0ac6a1
2 changed files with 6 additions and 1 deletions
|
@ -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
|
||||
|
||||
|
|
|
@ -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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue