-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #36 from kleis-technology/feature/lcaac-version
feature/lcaac version
- Loading branch information
Showing
5 changed files
with
39 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,13 @@ | ||
package ch.kleis.lcaac.cli | ||
|
||
import ch.kleis.lcaac.cli.cmd.AssessCommand | ||
import ch.kleis.lcaac.cli.cmd.LcaacCommand | ||
import ch.kleis.lcaac.cli.cmd.TestCommand | ||
import ch.kleis.lcaac.cli.cmd.TraceCommand | ||
import ch.kleis.lcaac.cli.cmd.* | ||
import com.github.ajalt.clikt.core.subcommands | ||
|
||
fun main(args: Array<String>) = LcaacCommand() | ||
.subcommands( | ||
AssessCommand(), | ||
TestCommand(), | ||
TraceCommand(), | ||
VersionCommand(), | ||
) | ||
.main(args) |
19 changes: 19 additions & 0 deletions
19
cli/src/main/kotlin/ch/kleis/lcaac/cli/cmd/VersionCommand.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package ch.kleis.lcaac.cli.cmd | ||
|
||
import com.github.ajalt.clikt.core.CliktCommand | ||
import java.util.Properties | ||
|
||
class VersionCommand : CliktCommand(name = "version", help = "Get version") { | ||
override fun run() { | ||
val propsFile = {}.javaClass.classLoader.getResourceAsStream("META-INF/lcaac.properties") | ||
val props = propsFile.use { | ||
Properties().apply { load(it) } | ||
} | ||
val author = props.getProperty("author") | ||
val description = props.getProperty("description") | ||
val version = props.getProperty("version") | ||
echo(description) | ||
echo("v${version}") | ||
echo(author) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
author=Kleis Technology | ||
description=LCA as Code CLI | ||
version=1.7.6 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters