| 1 | |
|
| 2 | |
|
| 3 | |
|
| 4 | |
|
| 5 | |
|
| 6 | |
package joptsimple; |
| 7 | |
|
| 8 | |
import java.util.Collections; |
| 9 | |
import java.util.List; |
| 10 | |
|
| 11 | |
|
| 12 | |
|
| 13 | |
|
| 14 | |
|
| 15 | |
|
| 16 | |
|
| 17 | |
|
| 18 | |
class NoArgumentOptionSpec extends OptionSpec { |
| 19 | |
NoArgumentOptionSpec( String option ) { |
| 20 | 90 | this( Collections.singletonList( option ), "" ); |
| 21 | 90 | } |
| 22 | |
|
| 23 | |
NoArgumentOptionSpec( List options, String description ) { |
| 24 | 632 | super( options, description ); |
| 25 | 632 | } |
| 26 | |
|
| 27 | |
void handleOption( OptionParser parser, ArgumentList arguments, |
| 28 | |
OptionSet detectedOptions, String detectedArgument ) { |
| 29 | |
|
| 30 | 116 | detectedOptions.addAll( options() ); |
| 31 | 116 | } |
| 32 | |
|
| 33 | |
boolean acceptsArguments() { |
| 34 | 30 | return false; |
| 35 | |
} |
| 36 | |
|
| 37 | |
boolean requiresArgument() { |
| 38 | 10 | return false; |
| 39 | |
} |
| 40 | |
|
| 41 | |
void accept( OptionSpecVisitor visitor ) { |
| 42 | 42 | visitor.visit( this ); |
| 43 | 42 | } |
| 44 | |
} |