01: /*
02: Copyright 2004-2007 Paul R. Holser, Jr. All rights reserved.
03: Licensed under the Academic Free License version 3.0
04: */
05:
06: package joptsimple;
07:
08: /**
09: * Represents the <code>"-W"</code> form of long option specification.
10: *
11: * @since 1.0
12: * @author <a href="mailto:pholser@alumni.rice.edu">Paul Holser</a>
13: * @version $Id: AlternativeLongOptionSpec.java,v 1.11 2007/04/10 20:06:25 pholser Exp $
14: */
15: class AlternativeLongOptionSpec extends ArgumentAcceptingOptionSpec {
16: AlternativeLongOptionSpec() {
17: super (ParserRules.RESERVED_FOR_EXTENSIONS, true,
18: "Alternative form of long options");
19:
20: describedAs("opt=value");
21: }
22:
23: protected void handleOptionFurther(OptionParser parser,
24: ArgumentList arguments, OptionSet detectedOptions) {
25:
26: if (!arguments.hasMore())
27: throw new OptionMissingRequiredArgumentException(option());
28:
29: arguments.treatNextAsLongOption();
30: }
31:
32: void accept(OptionSpecVisitor visitor) {
33: visitor.visit(this);
34: }
35: }
|