1 package org.openflow.example.cli;
7 String val; // current value of this option, string form
8 boolean specified; // was this option found in the cmdline?
12 * Option information storrage
15 * Short name for the option, e.g., "-p"
17 * Long name for option, e.g., "--port"
19 * default value: "6633" or null if no default value
21 * String to print to explain this option, e.g., a help message
23 public Option(String shortOpt, String longOpt, Object defaultVal,
26 this.shortOpt = shortOpt;
27 this.longOpt = longOpt;
28 this.defaultVal = defaultVal;
29 this.comment = comment;
30 this.specified = false;
33 public Option(String shortOpt, String longOpt, String comment) {
34 this(shortOpt, longOpt, null, comment);
37 public boolean needsArg() {
38 return this.defaultVal != null;