Added help argument.

This commit is contained in:
Deathsbreed 2014-04-08 22:02:56 -05:00
parent c170924b87
commit 64174d5c8e

View File

@ -15,6 +15,12 @@ public class MMMCalc {
System.out.println("Welcome to MMMCalc v0.1, a simple tool for basic statistics calculations.\n" +
"This software is licensed under the GNU GPLv3 license and comes WITHOUT WARRANTY.\n");
if(args.length > 0) {
if(args[0].equals("-h")) {
System.out.println("Usage:\n" +
" MMMCalc [options] [variables]\n\n" +
"Options:\n" +
" -h -- Show this help information.\n");
} else {
float sNum = 0;
numArray = new float[args.length];
@ -37,8 +43,9 @@ public class MMMCalc {
calcMean();
calcMedian();
calcMode();
}
} else {
System.out.println("You did not mention any variables.");
System.out.println("You did not mention any variables. Use the -h argument for help.");
}
}