Class CLI

java.lang.Object
net.royalur.cli.CLI

public class CLI extends Object
Parses CLI arguments.
  • Field Details

  • Constructor Details

  • Method Details

    • setCurrentCommand

      public void setCurrentCommand(@Nonnull CLICommand currentCommand)
      Used for things like printing help, or for help in error reporting.
    • parse

      public static CLI parse(String[] args)
    • printHelp

      public void printHelp(PrintStream out)
    • hasNext

      public boolean hasNext()
    • next

      public String next()
    • nextFile

      public File nextFile()
    • nextExistingFile

      public File nextExistingFile()
    • nextExistingDirectory

      public File nextExistingDirectory()
    • readKeywordIsPresent

      public boolean readKeywordIsPresent(String keyword)
    • readKeywordOrNull

      @Nullable public String readKeywordOrNull(String keyword)
    • readNonEmptyKeywordOrNull

      @Nullable public String readNonEmptyKeywordOrNull(String keyword)
    • readKeyword

      public String readKeyword(String keyword, String defaultValue)
    • readKeywordMap

      public <T> T readKeywordMap(String keyword, Map<String,T> map, T defaultValue)
    • readKeywordDouble

      public double readKeywordDouble(String keyword, double defaultValue)
    • readKeywordFile

      public File readKeywordFile(String keyword, File defaultValue)
    • readKeywordExistingFile

      public File readKeywordExistingFile(String keyword, File defaultValue)
    • readKeywordExistingDirectory

      public File readKeywordExistingDirectory(String keyword, File defaultValue)
    • clear

      public void clear()
    • expectEmpty

      public void expectEmpty()
    • rightPad

      public static String rightPad(String input, int minLength)
    • rightPadCommand

      public static String rightPadCommand(String command)
    • rightPadArgument

      public static String rightPadArgument(String argument)