[cli] make -version more usable

This commit is contained in:
Vasily Levchenko
2017-12-19 12:19:30 +03:00
committed by Vasily Levchenko
parent 6ee6f5907d
commit 3e949b4047
2 changed files with 6 additions and 1 deletions
@@ -42,6 +42,11 @@ class K2Native : CLICompiler<K2NativeCompilerArguments>() {
override fun doExecute(@NotNull arguments: K2NativeCompilerArguments, @NotNull configuration: CompilerConfiguration, @NotNull rootDisposable: Disposable, @Nullable paths: KotlinPaths?): ExitCode {
if (arguments.version) {
println("Kotlin/Native: ${KonanVersion.CURRENT}")
return ExitCode.OK
}
if (arguments.freeArgs.isEmpty() && !arguments.isUsefulWithoutFreeArgs) {
configuration.report(ERROR, "You have not specified any compilation arguments. No output has been produced.")
}
@@ -30,7 +30,7 @@ enum class MetaVersion {
class KonanVersion(val meta: MetaVersion?, val major: Int, val minor: Int, val maintenance: Int, val build:Int) {
companion object {
val CURRENT = KonanVersion(MetaVersion.EAP, 0, 1, 0, 0)
val CURRENT = KonanVersion(MetaVersion.EAP, 0, 6, 0, 0)
}
override fun toString() = if (meta != null) "$meta $major.$minor.$maintenance.$build" else "$major.$minor.$maintenance.$build"
}