diff --git a/build.gradle b/build.gradle index e8ff6b1..f75d1b8 100644 --- a/build.gradle +++ b/build.gradle @@ -1,4 +1,12 @@ plugins { id 'java' id 'eclipse' +} + +version = '0.9.1' + +jar { + manifest { + attributes 'Implementation-Version': version + } } \ No newline at end of file diff --git a/src/main/java/kz/pvnhome/pvnt/PVNTemplateRunner.java b/src/main/java/kz/pvnhome/pvnt/PVNTemplateRunner.java index 32c9db6..9824bbb 100644 --- a/src/main/java/kz/pvnhome/pvnt/PVNTemplateRunner.java +++ b/src/main/java/kz/pvnhome/pvnt/PVNTemplateRunner.java @@ -28,9 +28,9 @@ * @author victor */ public class PVNTemplateRunner { - public static void main(String[] args) { - System.out.println("PVN Template engine (version 0.91 beta)"); + public static final String VERSION = "0.91 beta"; + public static void main(String[] args) { String path = "."; String ext = "html"; boolean debugMode = false; @@ -40,6 +40,9 @@ public static void main(String[] args) { if ("-h".equals(args[0]) || "-help".equals(args[0])) { printUsage(); System.exit(0); + } else if ("-version".equals(args[0])) { + printVersion(); + System.exit(0); } else if ("-d".equals(args[0]) || "-debug".equals(args[0])) { debugMode = true; ind++; @@ -58,6 +61,8 @@ public static void main(String[] args) { System.exit(0); } + printVersion(); + System.out.println("INFO: Process all " + ext + " files in " + path + " (debug " + (debugMode ? "on" : "off") + ")"); try { @@ -91,9 +96,15 @@ public static void main(String[] args) { } private static void printUsage() { + printVersion(); System.out.println("usage: pvnt [options] [path/to/site [extension]]"); System.out.println("Options:"); System.out.println(" -help, -h print this message"); + System.out.println(" -version print the version information and exit"); System.out.println(" -debug, -d print debugging information"); } + + private static void printVersion() { + System.out.println("PVN Template engine (version " + VERSION + ")"); + } }