1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.apache.jdo.impl.enhancer;
18
19 import java.io.PrintWriter;
20
21 import java.util.List;
22 import java.util.Iterator;
23 import java.util.ArrayList;
24
25
26 /***
27 * Set of options used by the JDO enhancer and its test programs.
28 *
29 * @author Martin Zaun
30 */
31 public class GenericOptions
32 extends OptionSet
33 {
34 /***
35 * The help option.
36 */
37 public final HelpOption help
38 = createHelpOption("help", "h",
39 " : print usage message and exit");
40
41 /***
42 * The verbose option.
43 */
44 public final FlagOption verbose
45 = createFlagOption("verbose", "v",
46 " : print verbose messages");
47
48 /***
49 * The timing option.
50 */
51 public final FlagOption doTiming
52 = createFlagOption("timing", "t",
53 " : do timing messures");
54
55 /***
56 * Creates an instance.
57 */
58 public GenericOptions(PrintWriter out,
59 PrintWriter err)
60 {
61 super(out, err);
62 }
63
64
65
66 /***
67 * Tests the class.
68 */
69 static public void main(String[] args)
70 {
71 final PrintWriter out = new PrintWriter(System.out, true);
72 out.println("--> GenericOptions.main()");
73 final GenericOptions options = new GenericOptions(out, out);
74 out.println(" options.process() ...");
75 int res = options.process(args);
76 out.println(" return value: " + res);
77 out.println("<-- GenericOptions.main()");
78 }
79 }