mirror of
https://github.com/ethauvin/kobalt.git
synced 2025-04-27 00:38:11 -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()
|
var targets: List<String> = arrayListOf()
|
||||||
|
|
||||||
@Parameter(names = arrayOf("-bf", "--buildFile"), description = "The build file")
|
@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 " +
|
@Parameter(names = arrayOf("--checkVersions"), description = "Check if there are any newer versions of the " +
|
||||||
"dependencies")
|
"dependencies")
|
||||||
|
@ -17,6 +17,9 @@ class Args {
|
||||||
"actually running them")
|
"actually running them")
|
||||||
var dryRun: Boolean = false
|
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")
|
@Parameter(names = arrayOf("-i", "--init"), description = "Create a new build file based on the current project")
|
||||||
var init: Boolean = false
|
var init: Boolean = false
|
||||||
|
|
||||||
|
|
|
@ -109,6 +109,8 @@ private class Main @Inject constructor(
|
||||||
//
|
//
|
||||||
Wrapper().install()
|
Wrapper().install()
|
||||||
ProjectGenerator().run(args)
|
ProjectGenerator().run(args)
|
||||||
|
} else if (args.usage || args.targets.isEmpty()) {
|
||||||
|
jc.usage()
|
||||||
} else {
|
} else {
|
||||||
if (! buildFile.exists()) {
|
if (! buildFile.exists()) {
|
||||||
jc.usage()
|
jc.usage()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue