Browse files

Added -version switch

  • Loading branch information...
1 parent ef183af commit 76122779122f8b05aa409efe13d8fdc16cc7f141 @rzwitserloot committed Mar 5, 2012
View
2 src/com/zwitserloot/ivyplusplus/Version.java
@@ -23,7 +23,7 @@
public class Version {
// ** CAREFUL ** - this class must always compile with 0 dependencies (it must not refer to any other sources or libraries).
- private static final String VERSION = "1.8";
+ private static final String VERSION = "1.9";
private Version() {
//Prevent instantiation
View
11 src/com/zwitserloot/ivyplusplus/createProject/CreateProject.java
@@ -51,7 +51,7 @@
boolean help;
@Sequential
- @Mandatory(onlyIfNot={"help", "generate-key"})
+ @Mandatory(onlyIfNot={"help", "generate-key", "version"})
@Description("The name of your project. Example: com.zwitserloot.cmdreader")
String projectName;
@@ -82,6 +82,9 @@
@FullName("generate-key")
@Excludes({"freeware", "library", "junit", "projectName", "sonatype-forge"})
boolean generateMavenRepoSigningKey;
+
+ @Description("Shows version number and exits")
+ boolean version;
}
public static void main(String[] rawArgs) throws IOException {
@@ -103,6 +106,12 @@ public static void main(String[] rawArgs) throws IOException {
return;
}
+ if (args.version) {
+ System.out.println("ivyplusplus v" + Version.getVersion());
+ System.exit(0);
+ return;
+ }
+
if (args.generateMavenRepoSigningKey) {
System.exit(runGenerateMavenSigningKey());
return;

0 comments on commit 7612277

Please sign in to comment.