Package net.royalur.cli
Class CLI
java.lang.Object
net.royalur.cli.CLI
Parses CLI arguments.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()voidbooleanhasNext()next()nextFile()static CLIvoidprintHelp(PrintStream out) readKeyword(String keyword, String defaultValue) doublereadKeywordDouble(String keyword, double defaultValue) readKeywordExistingDirectory(String keyword, File defaultValue) readKeywordExistingFile(String keyword, File defaultValue) readKeywordFile(String keyword, File defaultValue) booleanreadKeywordIsPresent(String keyword) <T> TreadKeywordMap(String keyword, Map<String, T> map, T defaultValue) readKeywordOrNull(String keyword) readNonEmptyKeywordOrNull(String keyword) static Stringstatic StringrightPadArgument(String argument) static StringrightPadCommand(String command) voidsetCurrentCommand(CLICommand currentCommand) Used for things like printing help, or for help in error reporting.
-
Field Details
-
MS_DURATION
-
MIN_COMMAND_WIDTH
public static final int MIN_COMMAND_WIDTH- See Also:
-
MIN_ARGUMENT_WIDTH
public static final int MIN_ARGUMENT_WIDTH- See Also:
-
-
Constructor Details
-
CLI
-
-
Method Details
-
setCurrentCommand
Used for things like printing help, or for help in error reporting. -
parse
-
printHelp
-
hasNext
public boolean hasNext() -
next
-
nextFile
-
nextExistingFile
-
nextExistingDirectory
-
readKeywordIsPresent
-
readKeywordOrNull
-
readNonEmptyKeywordOrNull
-
readKeyword
-
readKeywordMap
-
readKeywordDouble
-
readKeywordFile
-
readKeywordExistingFile
-
readKeywordExistingDirectory
-
clear
public void clear() -
expectEmpty
public void expectEmpty() -
rightPad
-
rightPadCommand
-
rightPadArgument
-