Skip to content

Commit

Permalink
Added -version switch
Browse files Browse the repository at this point in the history
  • Loading branch information
rzwitserloot committed Mar 5, 2012
1 parent ef183af commit 7612277
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/com/zwitserloot/ivyplusplus/Version.java
Expand Up @@ -23,7 +23,7 @@


public class Version { public class Version {
// ** CAREFUL ** - this class must always compile with 0 dependencies (it must not refer to any other sources or libraries). // ** 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() { private Version() {
//Prevent instantiation //Prevent instantiation
Expand Down
11 changes: 10 additions & 1 deletion src/com/zwitserloot/ivyplusplus/createProject/CreateProject.java
Expand Up @@ -51,7 +51,7 @@ private static class CmdArgs {
boolean help; boolean help;


@Sequential @Sequential
@Mandatory(onlyIfNot={"help", "generate-key"}) @Mandatory(onlyIfNot={"help", "generate-key", "version"})
@Description("The name of your project. Example: com.zwitserloot.cmdreader") @Description("The name of your project. Example: com.zwitserloot.cmdreader")
String projectName; String projectName;


Expand Down Expand Up @@ -82,6 +82,9 @@ private static class CmdArgs {
@FullName("generate-key") @FullName("generate-key")
@Excludes({"freeware", "library", "junit", "projectName", "sonatype-forge"}) @Excludes({"freeware", "library", "junit", "projectName", "sonatype-forge"})
boolean generateMavenRepoSigningKey; boolean generateMavenRepoSigningKey;

@Description("Shows version number and exits")
boolean version;
} }


public static void main(String[] rawArgs) throws IOException { public static void main(String[] rawArgs) throws IOException {
Expand All @@ -103,6 +106,12 @@ public static void main(String[] rawArgs) throws IOException {
return; return;
} }


if (args.version) {
System.out.println("ivyplusplus v" + Version.getVersion());
System.exit(0);
return;
}

if (args.generateMavenRepoSigningKey) { if (args.generateMavenRepoSigningKey) {
System.exit(runGenerateMavenSigningKey()); System.exit(runGenerateMavenSigningKey());
return; return;
Expand Down

0 comments on commit 7612277

Please sign in to comment.