Defines the task, conditions and options to run a specific task in the listr.
Enable a task depending on the context.
The function that has been passed in will be evaluated at the initial creation of the Listr class for rendering purposes, as well as re-evaluated when the time for that specific task has come.
Set exit on the error option from task-level instead of setting it for all the subtasks.
Per task options, that depends on the selected renderer.
These options depend on the implementation of the selected renderer. If the selected renderer has no options it will be displayed as never.
Adds the given number of retry attempts to the task if the task fails.
Skip this task depending on the context.
The function that has been passed in will be evaluated at the runtime when the task tries to initially run.
Title of the task.
Give this task a title if you want to track it by name in the current renderer.
Tasks without a title will hide in the default renderer and are useful for running a background instance. On verbose renderer, state changes from these tasks will log as 'Task without a title.'
Runs a specific event if the current task or any of the subtasks has failed.
Mostly useful for rollback purposes for subtasks. But can also be useful whenever a task is failed and some measures have to be taken to ensure the state is not changed.