Skip to content

Commit

Permalink
Finished up V1.
Browse files Browse the repository at this point in the history
  • Loading branch information
BrandonKowalski committed Jun 15, 2015
1 parent 6626604 commit a477830
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 7 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<groupId>io.kowalski</groupId>
<artifactId>claptrap</artifactId>
<version>0.0.1</version>
<version>1.0.0</version>
<packaging>jar</packaging>

<name>claptrap</name>
Expand Down
18 changes: 18 additions & 0 deletions src/main/java/io/kowalski/claptrap/CLI.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@

public class CLI {

private static final String VERSION = "1.0.0";

public static void main(String[] args) {
parseArguments(args);
}
Expand All @@ -29,6 +31,10 @@ private static void parseArguments(String[] args) {
printHelp(options);
}

if (line.hasOption("version")) {
printVersion();
}

Settings settings = new Settings();

if(line.hasOption("http-port")) {
Expand Down Expand Up @@ -99,6 +105,13 @@ private static Options buildCLIOptions() {
.optionalArg(false)
.required(false)
.build());

options.addOption(Option.builder("v")
.longOpt("version")
.desc("displays the version of claptrap installed")
.hasArg(false)
.required(false)
.build());


return options;
Expand All @@ -109,5 +122,10 @@ private static void printHelp(Options options) {
formatter.printHelp("claptrap", options);
System.exit(0);
}

private static void printVersion() {
System.out.println(VERSION);
System.exit(0);
}

}
2 changes: 1 addition & 1 deletion src/main/resources/public/credits.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ <h3>Claptrap Credits &amp; License Information</h3><br>
<h5>A shoutout to the awesome folks!</h5>
</div>
<div class="six columns">
<a href="/" class="button pull-right">Home</a>
<a href="index.html" class="button pull-right">Home</a>
<a href="documentation.html" class="button pull-right">Documentation</a>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/public/documentation.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ <h3>Claptrap Documentation</h3><br>
<h5>Goodbye nonsensical email testing.</h5>
</div>
<div class="six columns">
<a href="/" class="button pull-right">Home</a>
<a href="index.html" class="button pull-right">Home</a>
<a href="credits.html" class="button pull-right">Credits</a>
</div>
</div>
Expand Down
8 changes: 4 additions & 4 deletions src/main/resources/public/js/claptrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ var loadEmails = function() {
var server = queryParams['server'] || $('#server-list').val();
$.ajax({
type : 'GET',
url : '/emails/' + server,
url : 'emails/' + server,
dataType : 'json',
success : function(data) {
buildTable(data);
Expand All @@ -21,7 +21,7 @@ var loadEmails = function() {
var loadServers = function() {
$.ajax({
type : 'GET',
url : '/servers',
url : 'servers',
dataType : 'json',
success : function(data) {
buildServerList(data);
Expand All @@ -35,7 +35,7 @@ var loadServers = function() {
var deleteEmail = function(server, emailId) {
$.ajax({
type : 'DELETE',
url : '/email/' + server + '/' + emailId,
url : 'email/' + server + '/' + emailId,
dataType : 'json',
success : function(data) {
$('#' + emailId).remove();
Expand All @@ -49,7 +49,7 @@ var deleteEmail = function(server, emailId) {
var deleteAllEmails = function(server) {
$.ajax({
type : 'DELETE',
url : '/email/' + server,
url : 'email/' + server,
dataType : 'json',
success : function(data) {
buildTable([]);
Expand Down

0 comments on commit a477830

Please sign in to comment.