From 2ef28f6c2e8c060753773dd8c86d4f632088c733 Mon Sep 17 00:00:00 2001 From: Deathsbreed Date: Thu, 13 Nov 2014 12:01:40 -0600 Subject: [PATCH] Added source-code. --- .gitignore | 2 ++ build.xml | 27 +++++++++++++++++++++++ src/coffeebreak/CoffeeBreak.java | 38 ++++++++++++++++++++++++++++++++ 3 files changed, 67 insertions(+) create mode 100644 .gitignore create mode 100644 build.xml create mode 100644 src/coffeebreak/CoffeeBreak.java diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..5958502 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +# Ignore binary files +bin/ diff --git a/build.xml b/build.xml new file mode 100644 index 0000000..7d59a58 --- /dev/null +++ b/build.xml @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/coffeebreak/CoffeeBreak.java b/src/coffeebreak/CoffeeBreak.java new file mode 100644 index 0000000..46a4104 --- /dev/null +++ b/src/coffeebreak/CoffeeBreak.java @@ -0,0 +1,38 @@ +package coffeebreak; + +/** + * @author Nicolás A. Ortega + * @copyright Nicolás A. Ortega + * @license GNU GPLv3 + * @year 2014 + * + */ +public class CoffeeBreak { + public static final String usage = "Usage: coffeebreak [compiler]"; + public String[] compilers = {"gcc", "g++", "clang++", "javac", "ant"}; + + public CoffeeBreak(String compiler) { + int compid = -1; + compilerLoop: + for(int i = 0; i < compilers.length; i++) { + if(compiler.equals(compilers[i])) { + compid = i; + break compilerLoop; + } + } + if(compid == -1) { + System.out.println("This compiler is not supported. Add it!!!"); + return; + } + System.out.println("You chose compiler " + compiler); + + } + + public static void main(String[] args) { + if(args.length != 1) { + System.out.println("Invalid number of arguments.\n" + usage); + return; + } + new CoffeeBreak(args[0]); + } +}