Package io.bdeploy.common.cli
Class ToolBase.CliTool
java.lang.Object
io.bdeploy.common.cli.ToolBase.CliTool
- Direct Known Subclasses:
ToolBase.ConfiguredCliTool,ToolBase.NativeCliTool
- Enclosing class:
- ToolBase
Base class for all CLI tools.
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected DataTableprotected DataResultprotected DataResultprotected DataResultcreateResultWithErrorMessage(String message) protected DataResultcreateResultWithSuccessMessage(String message) protected DataResultprotected ActivityReporterprotected DataFormatprotected booleanprotected PrintStreamout()abstract RenderableResultrun()Execute the tool.voidsetActivityReporter(ActivityReporter reporter) Set an alternativeActivityReporter.voidsetAuditorFactory(Function<Path, Auditor> auditorFactory) voidsetDataFormat(DataFormat dataMode) Sets the mode to render tables with.voidsetOutput(PrintStream output) Set an alternative output destination.voidsetVerbose(boolean verbose) Instructs tools which have some verbose output to print it.
-
Constructor Details
-
CliTool
public CliTool()
-
-
Method Details
-
setActivityReporter
Set an alternativeActivityReporter. -
getActivityReporter
- Returns:
- the current
ActivityReporter
-
setAuditorFactory
-
getAuditorFactory
-
setDataFormat
Sets the mode to render tables with. -
getDataFormat
- Returns:
- the current mode tables are rendered in.
-
createDataTable
-
createSuccess
-
createNoOp
-
createEmptyResult
-
createResultWithSuccessMessage
-
createResultWithErrorMessage
-
setOutput
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
- Returns:
- the current output destination. Can be used for any output on the CLI.
-
run
Execute the tool.
-