1 package org.openflow.codec.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, String comment) {
25 this.shortOpt = shortOpt;
26 this.longOpt = longOpt;
27 this.defaultVal = defaultVal;
28 this.comment = comment;
29 this.specified = false;
32 public Option(String shortOpt, String longOpt, String comment) {
33 this(shortOpt, longOpt, null, comment);
36 public boolean needsArg() {
37 return this.defaultVal != null;