MCPcopy Create free account
hub / github.com/apache/pig / registerOpt

Method registerOpt

src/org/apache/pig/tools/cmdline/CmdLineParser.java:63–79  ·  view source on GitHub ↗

Register a command line option. @param c Single character designator for this option. It cannot be '-'. @param s Full word designator for this option. This can be null, in which case no long designator will exist for this option. @param ve If REQUIRED, a value will be expected with this option. I

(char c, String s, ValueExpected ve)

Source from the content-addressed store, hash-verified

61 * used.
62 */
63public void registerOpt(char c, String s, ValueExpected ve)
64{
65 if (c == '-') {
66 throw new AssertionError("CmdLineParser: '-' is not a legal single character designator.");
67 }
68
69 Character cc = Character.valueOf(c);
70 if (mShort.put(cc, ve) != null) {
71 throw new AssertionError("CmdLineParser: You have already registered option " + cc.toString());
72 }
73
74 if (mLong != null) {
75 if (mLong.put(s, cc) != null) {
76 throw new AssertionError("CmdLineParser: You have already registered option " + s);
77 }
78 }
79}
80
81/**
82 * Get the next option.

Calls 2

putMethod · 0.45
toStringMethod · 0.45