Class ToolBase.CliTool

java.lang.Object
io.bdeploy.common.cli.ToolBase.CliTool
Direct Known Subclasses:
ToolBase.ConfiguredCliTool, ToolBase.NativeCliTool
Enclosing class:
ToolBase

public abstract static class ToolBase.CliTool extends Object
Base class for all CLI tools.
  • Constructor Details

    • CliTool

      public CliTool()
  • Method Details

    • setActivityReporter

      public void setActivityReporter(ActivityReporter reporter)
      Set an alternative ActivityReporter.
    • getActivityReporter

      protected ActivityReporter getActivityReporter()
      Returns:
      the current ActivityReporter
    • setAuditorFactory

      public void setAuditorFactory(Function<Path,Auditor> auditorFactory)
    • getAuditorFactory

      protected Function<Path,Auditor> getAuditorFactory()
    • setDataFormat

      public void setDataFormat(DataFormat dataMode)
      Sets the mode to render tables with.
    • getDataFormat

      protected DataFormat getDataFormat()
      Returns:
      the current mode tables are rendered in.
    • createDataTable

      protected DataTable createDataTable()
    • createSuccess

      protected DataResult createSuccess()
    • createNoOp

      protected DataResult createNoOp()
    • createEmptyResult

      protected DataResult createEmptyResult()
    • createResultWithSuccessMessage

      protected DataResult createResultWithSuccessMessage(String message)
    • createResultWithErrorMessage

      protected DataResult createResultWithErrorMessage(String message)
    • setOutput

      public void setOutput(PrintStream output)
      Set an alternative output destination.
    • setVerbose

      public void setVerbose(boolean verbose)
      Instructs tools which have some verbose output to print it.
    • isVerbose

      protected boolean isVerbose()
      Returns:
      whether verbose output should be produced
    • out

      protected PrintStream out()
      Returns:
      the current output destination. Can be used for any output on the CLI.
    • run

      public abstract RenderableResult run()
      Execute the tool.