| 1 | |
|
| 2 | |
|
| 3 | |
|
| 4 | |
|
| 5 | |
|
| 6 | |
package joptsimple; |
| 7 | |
|
| 8 | |
import java.util.Collections; |
| 9 | |
|
| 10 | |
|
| 11 | |
|
| 12 | |
|
| 13 | |
|
| 14 | |
|
| 15 | |
|
| 16 | |
|
| 17 | |
class AlternativeLongOptionSpec extends ArgumentAcceptingOptionSpec { |
| 18 | |
AlternativeLongOptionSpec() { |
| 19 | 22 | super( Collections.singletonList( ParserRules.RESERVED_FOR_EXTENSIONS ), true, |
| 20 | |
"Alternative form of long options" ); |
| 21 | |
|
| 22 | 22 | describedAs( "opt=value" ); |
| 23 | 22 | } |
| 24 | |
|
| 25 | |
protected void detectOptionArgument( OptionParser parser, ArgumentList arguments, |
| 26 | |
OptionSet detectedOptions ) { |
| 27 | |
|
| 28 | 16 | if ( !arguments.hasMore() ) |
| 29 | 2 | throw new OptionMissingRequiredArgumentException( options() ); |
| 30 | |
|
| 31 | 14 | arguments.treatNextAsLongOption(); |
| 32 | 14 | } |
| 33 | |
|
| 34 | |
void accept( OptionSpecVisitor visitor ) { |
| 35 | 2 | visitor.visit( this ); |
| 36 | 2 | } |
| 37 | |
} |