| 1 | |
|
| 2 | |
|
| 3 | |
|
| 4 | |
|
| 5 | |
|
| 6 | |
package joptsimple; |
| 7 | |
|
| 8 | |
|
| 9 | |
|
| 10 | |
|
| 11 | |
|
| 12 | |
|
| 13 | |
|
| 14 | |
|
| 15 | |
class ArgumentList { |
| 16 | |
private final String[] arguments; |
| 17 | |
private int currentIndex; |
| 18 | |
|
| 19 | 266 | ArgumentList( String[] arguments ) { |
| 20 | 266 | this.arguments = (String[]) arguments.clone(); |
| 21 | 264 | } |
| 22 | |
|
| 23 | |
boolean hasMore() { |
| 24 | 1040 | return currentIndex < arguments.length; |
| 25 | |
} |
| 26 | |
|
| 27 | |
String next() { |
| 28 | 758 | return arguments[ currentIndex++ ]; |
| 29 | |
} |
| 30 | |
|
| 31 | |
String peek() { |
| 32 | 92 | return arguments[ currentIndex ]; |
| 33 | |
} |
| 34 | |
|
| 35 | |
void treatNextAsLongOption() { |
| 36 | 24 | if ( ParserRules.HYPHEN_CHAR != arguments[ currentIndex ].charAt( 0 ) ) |
| 37 | 18 | arguments[ currentIndex ] = |
| 38 | |
ParserRules.DOUBLE_HYPHEN + arguments[ currentIndex ]; |
| 39 | 20 | } |
| 40 | |
} |