01: /* Generated by Together */
02:
03: package net.matuschek.getopt;
04:
05: public class GetOpt {
06: public GetOpt(String[] options) {
07: this .options = options;
08: }
09:
10: public boolean getOptionBoolean(String name) {
11: for (int i = 0; i < options.length; i++) {
12: if (options[i].equals("-" + name)) {
13: return true;
14: }
15: }
16: return false;
17: }
18:
19: public String getOptionString(String name) {
20: for (int i = 0; i < options.length - 1; i++) {
21: if (options[i].equals("-" + name)) {
22: return options[i + 1];
23: }
24: }
25: return null;
26: }
27:
28: private String[] options;
29: }
|