Class CLI

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

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

  • Method Details

    • parse

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

      public void setHelp(@Nonnull Consumer<PrintStream> help)
      As sub-commands are routed, they can update the help that is displayed when an error occurs.
    • 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()