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 TypeMethodDescriptionvoid
clear()
void
boolean
hasNext()
next()
nextFile()
static CLI
void
printHelp
(PrintStream out) readKeyword
(String keyword, String defaultValue) double
readKeywordDouble
(String keyword, double defaultValue) readKeywordExistingDirectory
(String keyword, File defaultValue) readKeywordExistingFile
(String keyword, File defaultValue) readKeywordFile
(String keyword, File defaultValue) boolean
readKeywordIsPresent
(String keyword) <T> T
readKeywordMap
(String keyword, Map<String, T> map, T defaultValue) readKeywordOrNull
(String keyword) readNonEmptyKeywordOrNull
(String keyword) static String
static String
rightPadArgument
(String argument) static String
rightPadCommand
(String command) void
setCurrentCommand
(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
-