org.jacoco.cli.internal
Class Command

java.lang.Object
  extended by 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 Summary
 boolean help
          Flag whether help should be printed for this command.
static String JAVACMD
          Common command line prefix.
 boolean quiet
          Flag whether output to stdout should be suppressed.
 
Constructor Summary
Command()
           
 
Method Summary
abstract  String description()
           
abstract  int execute(PrintWriter out, PrintWriter err)
          Executes the given command.
 String name()
           
protected  void printHelp(PrintWriter writer)
          Prints textual help for this command.
 String usage(CommandParser parser)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

JAVACMD

public static final String JAVACMD
Common command line prefix.

See Also:
Constant Field Values

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 Detail

Command

public Command()
Method Detail

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


Copyright © 2009–2023 Mountainminds GmbH & Co. KG. All rights reserved.