Class Command

java.lang.Object
org.jacoco.cli.internal.Command
Direct Known Subclasses:
ClassInfo, Dump, ExecInfo, Instrument, Main, Merge, Report, Version

public abstract class Command extends Object
Common interface for all commands.
  • Field Details

    • JAVACMD

      public static final String JAVACMD
      Common command line prefix.
      See Also:
    • help

      public boolean help
      Flag whether help should be printed for this command.
    • quiet

      public boolean quiet
      Flag whether output to stdout should be suppressed.
  • Constructor Details

    • Command

      public Command()
  • Method Details

    • description

      public abstract String description()
      Returns:
      Short description of the command.
    • name

      public String name()
      Returns:
      name of the command
    • usage

      public String usage(CommandParser parser)
      Parameters:
      parser - parser for this command
      Returns:
      usage string displayed for help
    • execute

      public abstract int execute(PrintWriter out, PrintWriter err) throws Exception
      Executes the given command.
      Parameters:
      out - std out
      err - std err
      Returns:
      exit code, should be 0 for normal operation
      Throws:
      Exception - any exception that my occur during execution
    • printHelp

      protected void printHelp(PrintWriter writer)
      Prints textual help for this command.
      Parameters:
      writer - output destination