aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGlavo <zjx001202@126.com>2019-12-06 03:48:20 +0800
committerGlavo <zjx001202@126.com>2019-12-06 03:48:20 +0800
commit9d9b24ef2e70290dbcec47de530d4dd72c35d32d (patch)
tree33042ba8c394f01bed550f101958b2df8d87408b
parent5149f8287d6240c83ae4bff39fa94e59a8849dad (diff)
downloadgjavah-9d9b24ef2e70290dbcec47de530d4dd72c35d32d.zip
gjavah-9d9b24ef2e70290dbcec47de530d4dd72c35d32d.tar.gz
gjavah-9d9b24ef2e70290dbcec47de530d4dd72c35d32d.tar.bz2
fix show version bug0.2.0
-rw-r--r--src/main/java/org/glavo/javah/Main.java5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/main/java/org/glavo/javah/Main.java b/src/main/java/org/glavo/javah/Main.java
index a83c2e2..3c2be04 100644
--- a/src/main/java/org/glavo/javah/Main.java
+++ b/src/main/java/org/glavo/javah/Main.java
@@ -16,7 +16,7 @@ import java.util.stream.Stream;
import static picocli.CommandLine.*;
-@Command(name = "gjavah", version = "gjavah %1", sortOptions = false)
+@Command(name = "gjavah", version = "gjavah ${gjavah.version}", sortOptions = false)
public class Main {
@Option(names = {"-p", "--module-path"}, description = "Path from which to search modules")
private String modulePath;
@@ -50,7 +50,8 @@ public class Main {
}
if (m.showVersion) {
try (InputStream in = Main.class.getResourceAsStream("/META-INF/MANIFEST.MF")) {
- cm.printVersionHelp(System.out, Help.Ansi.AUTO, new Manifest(in).getMainAttributes().getValue("GJavah-Version"));
+ System.setProperty("gjavah.version", new Manifest(in).getMainAttributes().getValue("GJavah-Version"));
+ cm.printVersionHelp(System.out);
}
return;
}