Class CliTool

java.lang.Object
morfologik.tools.CliTool
All Implemented Interfaces:
Callable<ExitStatus>
Direct Known Subclasses:
DictApply, DictCompile, DictDecompile, FSACompile, FSADecompile, FSAInfo

public abstract class CliTool extends Object implements Callable<ExitStatus>
Base class for command-line applications.
  • Field Details

  • Constructor Details

    • CliTool

      public CliTool()
  • Method Details

    • setCallSystemExit

      public void setCallSystemExit(boolean flag)
      Call System.exit(int) at the end of command processing.
      Parameters:
      flag - Call System.exit(int) if true.
    • main

      protected static void main(String[] args, CliTool... commands)
      Parse and execute one of the commands.
      Parameters:
      args - Command line arguments (command and options).
      commands - A list of commands.
    • main

      protected static void main(String[] args, CliTool command)
      Parse and execute a single command.
      Parameters:
      args - Command line arguments (command and options).
      command - The command to execute.
    • printf

      protected static void printf(String msg, Object... args)
    • checkNotNull

      protected static <T> T checkNotNull(T arg)
    • helpDisplayCommandOptions

      private static void helpDisplayCommandOptions(PrintStream pw, String command, com.beust.jcommander.JCommander jc)
    • helpDisplayCommandOptions

      private static void helpDisplayCommandOptions(PrintStream pw, com.beust.jcommander.JCommander jc)