Added help argument.
This commit is contained in:
parent
c170924b87
commit
64174d5c8e
@ -15,6 +15,12 @@ public class MMMCalc {
|
|||||||
System.out.println("Welcome to MMMCalc v0.1, a simple tool for basic statistics calculations.\n" +
|
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");
|
"This software is licensed under the GNU GPLv3 license and comes WITHOUT WARRANTY.\n");
|
||||||
if(args.length > 0) {
|
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;
|
float sNum = 0;
|
||||||
numArray = new float[args.length];
|
numArray = new float[args.length];
|
||||||
|
|
||||||
@ -37,8 +43,9 @@ public class MMMCalc {
|
|||||||
calcMean();
|
calcMean();
|
||||||
calcMedian();
|
calcMedian();
|
||||||
calcMode();
|
calcMode();
|
||||||
|
}
|
||||||
} else {
|
} 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.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user